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
a247e24c
Commit
a247e24c
authored
Dec 23, 2014
by
Brian Tiger Chow
Committed by
Juan Batiz-Benet
Dec 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(bitswap) always use prvivate `send` method to send
cc @whyrusleeping
parent
05c10446
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
15 deletions
+2
-15
bitswap.go
bitswap.go
+2
-15
No files found.
bitswap.go
View file @
a247e24c
...
...
@@ -182,23 +182,10 @@ func (bs *bitswap) sendWantListTo(ctx context.Context, peers <-chan peer.PeerInf
wg
.
Add
(
1
)
go
func
(
p
peer
.
ID
)
{
defer
wg
.
Done
()
log
.
Event
(
ctx
,
"DialPeer"
,
p
)
err
:=
bs
.
sender
.
DialPeer
(
ctx
,
p
)
if
err
!=
nil
{
log
.
Errorf
(
"Error sender.DialPeer(%s): %s"
,
p
,
err
)
return
}
err
=
bs
.
sender
.
SendMessage
(
ctx
,
p
,
message
)
if
err
!=
nil
{
log
.
Errorf
(
"Error sender.SendMessage(%s) = %s"
,
p
,
err
)
if
err
:=
bs
.
send
(
ctx
,
p
,
message
);
err
!=
nil
{
log
.
Error
(
err
)
return
}
// FIXME ensure accounting is handled correctly when
// communication fails. May require slightly different API to
// get better guarantees. May need shared sequence numbers.
bs
.
engine
.
MessageSent
(
p
,
message
)
}(
peerToQuery
.
ID
)
}
wg
.
Wait
()
...
...
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