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
p2p
go-p2p-swarm
Commits
5d9d431e
Commit
5d9d431e
authored
Oct 18, 2017
by
Steven Allen
Committed by
GitHub
Oct 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38 from libp2p/fix/libp2p/go-libp2p-kad-dht/96
don't backoff dialing when the context is canceled
parents
72ef23a7
37045022
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
swarm_dial.go
swarm_dial.go
+4
-2
No files found.
swarm_dial.go
View file @
5d9d431e
...
@@ -203,8 +203,10 @@ func (s *Swarm) doDial(ctx context.Context, p peer.ID) (*Conn, error) {
...
@@ -203,8 +203,10 @@ func (s *Swarm) doDial(ctx context.Context, p peer.ID) (*Conn, error) {
cancel
()
cancel
()
log
.
Debugf
(
"dial end %s"
,
conn
)
log
.
Debugf
(
"dial end %s"
,
conn
)
if
err
!=
nil
{
if
err
!=
nil
{
if
err
!=
context
.
Canceled
{
log
.
Event
(
ctx
,
"swarmDialBackoffAdd"
,
logdial
)
log
.
Event
(
ctx
,
"swarmDialBackoffAdd"
,
logdial
)
s
.
backf
.
AddBackoff
(
p
)
// let others know to backoff
s
.
backf
.
AddBackoff
(
p
)
// let others know to backoff
}
// ok, we failed. try again. (if loop is done, our error is output)
// ok, we failed. try again. (if loop is done, our error is output)
return
nil
,
fmt
.
Errorf
(
"dial attempt failed: %s"
,
err
)
return
nil
,
fmt
.
Errorf
(
"dial attempt failed: %s"
,
err
)
...
...
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