Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
f408b582
Unverified
Commit
f408b582
authored
Jun 26, 2020
by
metacertain
Committed by
GitHub
Jun 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close errorful but created streams (#383)
* Close errorful but created streams
parent
6160b927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
libp2p.go
pkg/p2p/libp2p/libp2p.go
+4
-0
No files found.
pkg/p2p/libp2p/libp2p.go
View file @
f408b582
...
...
@@ -462,6 +462,10 @@ func (s *Service) newStreamForPeerID(ctx context.Context, peerID libp2ppeer.ID,
swarmStreamName
:=
p2p
.
NewSwarmStreamName
(
protocolName
,
protocolVersion
,
streamName
)
st
,
err
:=
s
.
host
.
NewStream
(
ctx
,
peerID
,
protocol
.
ID
(
swarmStreamName
))
if
err
!=
nil
{
if
st
!=
nil
{
s
.
logger
.
Debug
(
"stream experienced unexpected early close"
)
_
=
st
.
Close
()
}
if
err
==
multistream
.
ErrNotSupported
||
err
==
multistream
.
ErrIncorrectVersion
{
return
nil
,
p2p
.
NewIncompatibleStreamError
(
err
)
}
...
...
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