Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
0436764f
Commit
0436764f
authored
9 years ago
by
Jeromy Johnson
Browse files
Options
Download
Plain Diff
Merge pull request #44 from ipfs/fix/dial-read-deadline
add a read deadline for the multistream select on dial
parents
17632a3b
d8a6d25b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
p2p/net/conn/dial.go
+5
-0
p2p/net/conn/dial.go
with
5 additions
and
0 deletions
+5
-0
p2p/net/conn/dial.go
View file @
0436764f
...
...
@@ -4,6 +4,7 @@ import (
"fmt"
"math/rand"
"strings"
"time"
ci
"github.com/ipfs/go-libp2p-crypto"
lgbl
"github.com/ipfs/go-libp2p-loggables"
...
...
@@ -68,12 +69,16 @@ func (d *Dialer) Dial(ctx context.Context, raddr ma.Multiaddr, remote peer.ID) (
cryptoProtoChoice
=
NoEncryptionTag
}
maconn
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
NegotiateReadTimeout
))
err
=
msmux
.
SelectProtoOrFail
(
cryptoProtoChoice
,
maconn
)
if
err
!=
nil
{
errOut
=
err
return
}
maconn
.
SetReadDeadline
(
time
.
Time
{})
c
,
err
:=
newSingleConn
(
ctx
,
d
.
LocalPeer
,
remote
,
maconn
)
if
err
!=
nil
{
maconn
.
Close
()
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help