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-blankhost
Commits
7f810d41
Commit
7f810d41
authored
Jun 24, 2020
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: reset stream on error
This may have been leaking streams with AutoNAT.
parent
a3d48bab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
blank.go
blank.go
+2
-2
No files found.
blank.go
View file @
7f810d41
...
@@ -152,7 +152,7 @@ func (bh *BlankHost) NewStream(ctx context.Context, p peer.ID, protos ...protoco
...
@@ -152,7 +152,7 @@ func (bh *BlankHost) NewStream(ctx context.Context, p peer.ID, protos ...protoco
selected
,
err
:=
mstream
.
SelectOneOf
(
protoStrs
,
s
)
selected
,
err
:=
mstream
.
SelectOneOf
(
protoStrs
,
s
)
if
err
!=
nil
{
if
err
!=
nil
{
s
.
Clo
se
()
s
.
Re
se
t
()
return
nil
,
err
return
nil
,
err
}
}
...
@@ -199,7 +199,7 @@ func (bh *BlankHost) newStreamHandler(s network.Stream) {
...
@@ -199,7 +199,7 @@ func (bh *BlankHost) newStreamHandler(s network.Stream) {
protoID
,
handle
,
err
:=
bh
.
Mux
()
.
Negotiate
(
s
)
protoID
,
handle
,
err
:=
bh
.
Mux
()
.
Negotiate
(
s
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Infow
(
"protocol negotiation failed"
,
"error"
,
err
)
log
.
Infow
(
"protocol negotiation failed"
,
"error"
,
err
)
s
.
Clo
se
()
s
.
Re
se
t
()
return
return
}
}
...
...
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