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
dms3
go-bitswap
Commits
a8ed6515
Commit
a8ed6515
authored
Apr 17, 2020
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use explicit connected bool for streamMessageSender
parent
bdccb20e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
network/ipfs_impl.go
network/ipfs_impl.go
+8
-6
No files found.
network/ipfs_impl.go
View file @
a8ed6515
...
...
@@ -90,15 +90,16 @@ type impl struct {
}
type
streamMessageSender
struct
{
to
peer
.
ID
stream
network
.
Stream
bsnet
*
impl
opts
*
MessageSenderOpts
to
peer
.
ID
stream
network
.
Stream
connected
bool
bsnet
*
impl
opts
*
MessageSenderOpts
}
// Open a stream to the remote peer
func
(
s
*
streamMessageSender
)
Connect
(
ctx
context
.
Context
)
(
network
.
Stream
,
error
)
{
if
s
.
stream
!=
nil
{
if
s
.
connected
{
return
s
.
stream
,
nil
}
...
...
@@ -112,6 +113,7 @@ func (s *streamMessageSender) Connect(ctx context.Context) (network.Stream, erro
}
s
.
stream
=
stream
s
.
connected
=
true
return
s
.
stream
,
nil
}
...
...
@@ -119,7 +121,7 @@ func (s *streamMessageSender) Connect(ctx context.Context) (network.Stream, erro
func
(
s
*
streamMessageSender
)
Reset
()
error
{
if
s
.
stream
!=
nil
{
err
:=
s
.
stream
.
Reset
()
s
.
stream
=
nil
s
.
connected
=
false
return
err
}
return
nil
...
...
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