Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
3c10e99c
Commit
3c10e99c
authored
Mar 07, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added cancel func calls previously ignored
parent
f91baafb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
bitswap.go
bitswap.go
+4
-2
No files found.
bitswap.go
View file @
3c10e99c
...
...
@@ -269,7 +269,8 @@ func (bs *Bitswap) sendWantlistToProviders(ctx context.Context, entries []wantli
go
func
(
k
u
.
Key
)
{
defer
wg
.
Done
()
child
,
_
:=
context
.
WithTimeout
(
ctx
,
providerRequestTimeout
)
child
,
cancel
:=
context
.
WithTimeout
(
ctx
,
providerRequestTimeout
)
defer
cancel
()
providers
:=
bs
.
network
.
FindProvidersAsync
(
child
,
k
,
maxProvidersPerRequest
)
for
prov
:=
range
providers
{
sendToPeers
<-
prov
...
...
@@ -311,10 +312,11 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
// Should only track *useful* messages in ledger
for
_
,
block
:=
range
incoming
.
Blocks
()
{
hasBlockCtx
,
_
:=
context
.
WithTimeout
(
ctx
,
hasBlockTimeout
)
hasBlockCtx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
hasBlockTimeout
)
if
err
:=
bs
.
HasBlock
(
hasBlockCtx
,
block
);
err
!=
nil
{
log
.
Debug
(
err
)
}
cancel
()
}
var
keys
[]
u
.
Key
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment