Skip to content
GitLab
Menu
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
91514ce0
Unverified
Commit
91514ce0
authored
Oct 24, 2018
by
Steven Allen
Committed by
GitHub
Oct 24, 2018
Browse files
Merge pull request #465 from libp2p/fix/mock-race-really
*really* fix the race in mock
parents
8af9bc62
80c59982
Changes
1
Hide whitespace changes
Inline
Side-by-side
p2p/net/mock/mock_stream.go
View file @
91514ce0
...
@@ -64,7 +64,7 @@ func (s *stream) Write(p []byte) (n int, err error) {
...
@@ -64,7 +64,7 @@ func (s *stream) Write(p []byte) (n int, err error) {
select
{
select
{
case
<-
s
.
closed
:
// bail out if we're closing.
case
<-
s
.
closed
:
// bail out if we're closing.
return
0
,
s
.
writeErr
return
0
,
s
.
writeErr
case
s
.
toDeliver
<-
&
transportObject
{
msg
:
p
,
arrivalTime
:
t
}
:
case
s
.
toDeliver
<-
&
transportObject
{
msg
:
cpy
,
arrivalTime
:
t
}
:
}
}
return
len
(
p
),
nil
return
len
(
p
),
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