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
0cf68a57
Commit
0cf68a57
authored
Feb 04, 2021
by
vyzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
treat transient conns as opt-in for opening new streams
parent
746f908d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
swarm.go
swarm.go
+7
-0
No files found.
swarm.go
View file @
0cf68a57
...
...
@@ -351,6 +351,13 @@ func (s *Swarm) NewStream(ctx context.Context, p peer.ID) (network.Stream, error
return
nil
,
err
}
}
if
c
.
Stat
()
.
Transient
{
if
!
network
.
GetUseTransient
(
ctx
)
{
return
nil
,
network
.
ErrTransientConn
}
}
s
,
err
:=
c
.
NewStream
(
ctx
)
if
err
!=
nil
{
if
c
.
conn
.
IsClosed
()
{
...
...
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