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
98ec801f
Commit
98ec801f
authored
Mar 08, 2019
by
Matt Joiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for context failure, rather than a specific downstream error
parent
94712cc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
swarm_dial.go
swarm_dial.go
+2
-2
No files found.
swarm_dial.go
View file @
98ec801f
...
...
@@ -84,7 +84,7 @@ const DefaultPerPeerRateLimit = 8
// DialBackoff is a type for tracking peer dial backoffs.
//
// * It's safe to use it
'
s zero value.
// * It's safe to use its zero value.
// * It's thread-safe.
// * It's *not* safe to move this type after using.
type
DialBackoff
struct
{
...
...
@@ -248,7 +248,7 @@ func (s *Swarm) doDial(ctx context.Context, p peer.ID) (*Conn, error) {
log
.
Debugf
(
"ignoring dial error because we have a connection: %s"
,
err
)
return
conn
,
nil
}
if
err
!=
context
.
Canceled
{
if
ctx
.
Err
()
==
nil
{
log
.
Event
(
ctx
,
"swarmDialBackoffAdd"
,
logdial
)
s
.
backf
.
AddBackoff
(
p
)
// let others know to backoff
}
...
...
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