@@ -14,7 +14,7 @@ import { Context, Hash, HashedObject } from 'data/model';
1414import { AsyncStream , BufferedAsyncStream , BufferingAsyncStreamSource } from 'util/streams' ;
1515import { ObjectDiscoveryReply } from 'mesh/agents/discovery' ;
1616import { Endpoint } from 'mesh/agents/network' ;
17- import { LinkupManager , LinkupManagerCommand , LinkupManagerProxy } from 'net/linkup' ;
17+ import { LinkupAddress , LinkupManager , LinkupManagerCommand , LinkupManagerProxy } from 'net/linkup' ;
1818import { WebRTCConnectionEvent , WebRTCConnectionsHost } from 'net/transport' ;
1919
2020class MeshProxy {
@@ -267,7 +267,7 @@ class MeshProxy {
267267 this . commandForwardingFn ( cmd ) ;
268268 }
269269
270- findObjectByHash ( hash : Hash , linkupServers : string [ ] , replyEndpoint : Endpoint , count = 1 , maxAge = 30 , strictEndpoints = false ) : AsyncStream < ObjectDiscoveryReply > {
270+ findObjectByHash ( hash : Hash , linkupServers : string [ ] , replyAddress : LinkupAddress , count = 1 , maxAge = 30 , strictEndpoints = false ) : AsyncStream < ObjectDiscoveryReply > {
271271 const streamId = new RNGImpl ( ) . randomHexString ( 64 ) ;
272272
273273 const src = new BufferingAsyncStreamSource < ObjectDiscoveryReply > ( )
@@ -278,7 +278,8 @@ class MeshProxy {
278278 type : 'find-object-by-hash' ,
279279 hash : hash ,
280280 linkupServers : linkupServers ,
281- replyEndpoint : replyEndpoint ,
281+ replyEndpoint : replyAddress . url ( ) ,
282+ replyIdentity : replyAddress . identity === undefined ? undefined : replyAddress . identity . toLiteralContext ( ) ,
282283 count : count ,
283284 maxAge : maxAge ,
284285 strictEndpoints : strictEndpoints ,
@@ -291,7 +292,7 @@ class MeshProxy {
291292 return new BufferedAsyncStream < ObjectDiscoveryReply > ( src ) ;
292293 }
293294
294- findObjectByHashSuffix ( hashSuffix : string , linkupServers : string [ ] , replyEndpoint : Endpoint , count = 1 , maxAge = 30 , strictEndpoints = false ) : AsyncStream < ObjectDiscoveryReply > {
295+ findObjectByHashSuffix ( hashSuffix : string , linkupServers : string [ ] , replyAddress : LinkupAddress , count = 1 , maxAge = 30 , strictEndpoints = false ) : AsyncStream < ObjectDiscoveryReply > {
295296 const streamId = new RNGImpl ( ) . randomHexString ( 64 ) ;
296297
297298 const src = new BufferingAsyncStreamSource < ObjectDiscoveryReply > ( )
@@ -302,7 +303,8 @@ class MeshProxy {
302303 type : 'find-object-by-hash-suffix' ,
303304 hashSuffix : hashSuffix ,
304305 linkupServers : linkupServers ,
305- replyEndpoint : replyEndpoint ,
306+ replyEndpoint : replyAddress . url ( ) ,
307+ replyIdentity : replyAddress . identity === undefined ? undefined : replyAddress . identity . toLiteralContext ( ) ,
306308 count : count ,
307309 maxAge : maxAge ,
308310 strictEndpoints : strictEndpoints ,
@@ -321,25 +323,27 @@ class MeshProxy {
321323 this . commandForwardingFn ( cmd ) ;
322324 }
323325
324- findObjectByHashRetry ( hash : Hash , linkupServers : string [ ] , replyEndpoint : Endpoint , count = 1 ) : void {
326+ findObjectByHashRetry ( hash : Hash , linkupServers : string [ ] , replyAddress : LinkupAddress , count = 1 ) : void {
325327 const cmd : FindObjectByHash = {
326328 type : 'find-object-by-hash' ,
327329 hash : hash ,
328330 linkupServers : linkupServers ,
329- replyEndpoint : replyEndpoint ,
331+ replyEndpoint : replyAddress . url ( ) ,
332+ replyIdentity : replyAddress . identity === undefined ? undefined : replyAddress . identity . toLiteralContext ( ) ,
330333 count : count ,
331334 retry : true ,
332335 }
333336
334337 this . commandForwardingFn ( cmd ) ;
335338 }
336339
337- findObjectByHashSuffixRetry ( hashSuffix : string , linkupServers : string [ ] , replyEndpoint : Endpoint , count = 1 ) : void {
340+ findObjectByHashSuffixRetry ( hashSuffix : string , linkupServers : string [ ] , replyAddress : LinkupAddress , count = 1 ) : void {
338341 const cmd : FindObjectByHashSuffix = {
339342 type : 'find-object-by-hash-suffix' ,
340343 hashSuffix : hashSuffix ,
341344 linkupServers : linkupServers ,
342- replyEndpoint : replyEndpoint ,
345+ replyEndpoint : replyAddress . url ( ) ,
346+ replyIdentity : replyAddress . identity === undefined ? undefined : replyAddress . identity . toLiteralContext ( ) ,
343347 count : count ,
344348 retry : true ,
345349 }
0 commit comments