@@ -97,8 +97,9 @@ func (dht *IpfsDHT) GetValue(ctx context.Context, key key.Key) ([]byte, error) {
97
97
}
98
98
99
99
// setup the Query
100
+ parent := ctx
100
101
query := dht .newQuery (key , func (ctx context.Context , p peer.ID ) (* dhtQueryResult , error ) {
101
- notif .PublishQueryEvent (ctx , & notif.QueryEvent {
102
+ notif .PublishQueryEvent (parent , & notif.QueryEvent {
102
103
Type : notif .SendingQuery ,
103
104
ID : p ,
104
105
})
@@ -113,7 +114,7 @@ func (dht *IpfsDHT) GetValue(ctx context.Context, key key.Key) ([]byte, error) {
113
114
res .success = true
114
115
}
115
116
116
- notif .PublishQueryEvent (ctx , & notif.QueryEvent {
117
+ notif .PublishQueryEvent (parent , & notif.QueryEvent {
117
118
Type : notif .PeerResponse ,
118
119
ID : p ,
119
120
Responses : pointerizePeerInfos (peers ),
@@ -209,8 +210,9 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key,
209
210
}
210
211
211
212
// setup the Query
213
+ parent := ctx
212
214
query := dht .newQuery (key , func (ctx context.Context , p peer.ID ) (* dhtQueryResult , error ) {
213
- notif .PublishQueryEvent (ctx , & notif.QueryEvent {
215
+ notif .PublishQueryEvent (parent , & notif.QueryEvent {
214
216
Type : notif .SendingQuery ,
215
217
ID : p ,
216
218
})
@@ -246,7 +248,7 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key,
246
248
clpeers := pb .PBPeersToPeerInfos (closer )
247
249
log .Debugf ("got closer peers: %d %s" , len (clpeers ), clpeers )
248
250
249
- notif .PublishQueryEvent (ctx , & notif.QueryEvent {
251
+ notif .PublishQueryEvent (parent , & notif.QueryEvent {
250
252
Type : notif .PeerResponse ,
251
253
ID : p ,
252
254
Responses : pointerizePeerInfos (clpeers ),
@@ -288,8 +290,9 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, er
288
290
}
289
291
290
292
// setup the Query
293
+ parent := ctx
291
294
query := dht .newQuery (key .Key (id ), func (ctx context.Context , p peer.ID ) (* dhtQueryResult , error ) {
292
- notif .PublishQueryEvent (ctx , & notif.QueryEvent {
295
+ notif .PublishQueryEvent (parent , & notif.QueryEvent {
293
296
Type : notif .SendingQuery ,
294
297
ID : p ,
295
298
})
@@ -312,7 +315,7 @@ func (dht *IpfsDHT) FindPeer(ctx context.Context, id peer.ID) (peer.PeerInfo, er
312
315
}
313
316
}
314
317
315
- notif .PublishQueryEvent (ctx , & notif.QueryEvent {
318
+ notif .PublishQueryEvent (parent , & notif.QueryEvent {
316
319
Type : notif .PeerResponse ,
317
320
Responses : pointerizePeerInfos (clpeerInfos ),
318
321
})
0 commit comments