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
e7b6af60
Commit
e7b6af60
authored
Mar 31, 2021
by
vyzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do a last ditch check for acceptable connections before dispatching a dial error
parent
12a0cdb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
swarm_dial.go
swarm_dial.go
+8
-1
No files found.
swarm_dial.go
View file @
e7b6af60
...
...
@@ -341,7 +341,14 @@ func (s *Swarm) dialWorkerLoop(ctx context.Context, p peer.ID, reqch <-chan Dial
delete
(
pr
.
addrs
,
ad
.
addr
)
if
len
(
pr
.
addrs
)
==
0
{
// all addrs have erred, dispatch dial error
pr
.
req
.
Resch
<-
DialResponse
{
Err
:
pr
.
err
}
// but first do a last one check in case an acceptable connection has landed from
// a simultaneous dial that started later and added new acceptable addrs
c
:=
s
.
bestAcceptableConnToPeer
(
pr
.
req
.
Ctx
,
p
)
if
c
!=
nil
{
pr
.
req
.
Resch
<-
DialResponse
{
Conn
:
c
}
}
else
{
pr
.
req
.
Resch
<-
DialResponse
{
Err
:
pr
.
err
}
}
delete
(
requests
,
reqno
)
}
}
...
...
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