Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
715f8950
"frontend/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "79aff2df318358986e0483cb02b0e54c2f303436"
Commit
715f8950
authored
Apr 24, 2015
by
Jeromy
Browse files
bring some errors that were being hidden in the dial sequence to the surface
parent
4a260476
Changes
1
Show whitespace changes
Inline
Side-by-side
net/swarm/swarm_dial.go
View file @
715f8950
...
@@ -237,7 +237,8 @@ func (s *Swarm) gatedDialAttempt(ctx context.Context, p peer.ID) (*Conn, error)
...
@@ -237,7 +237,8 @@ func (s *Swarm) gatedDialAttempt(ctx context.Context, p peer.ID) (*Conn, error)
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
return
nil
,
ErrDialFailed
// 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
)
}
}
log
.
Event
(
ctx
,
"swarmDialBackoffClear"
,
logdial
)
log
.
Event
(
ctx
,
"swarmDialBackoffClear"
,
logdial
)
s
.
backf
.
Clear
(
p
)
// okay, no longer need to backoff
s
.
backf
.
Clear
(
p
)
// okay, no longer need to backoff
...
@@ -416,7 +417,7 @@ func (s *Swarm) dialAddrs(ctx context.Context, d *conn.Dialer, p peer.ID, remote
...
@@ -416,7 +417,7 @@ func (s *Swarm) dialAddrs(ctx context.Context, d *conn.Dialer, p peer.ID, remote
for
i
:=
0
;
i
<
len
(
remoteAddrs
);
i
++
{
for
i
:=
0
;
i
<
len
(
remoteAddrs
);
i
++
{
select
{
select
{
case
exitErr
=
<-
errs
:
//
case
exitErr
=
<-
errs
:
//
log
.
Debug
(
exitErr
)
log
.
Warning
(
"dial error: "
,
exitErr
)
case
connC
:=
<-
conns
:
case
connC
:=
<-
conns
:
// take the first + return asap
// take the first + return asap
close
(
foundConn
)
close
(
foundConn
)
...
...
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