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-graphsync
Commits
45f5c8cb
Commit
45f5c8cb
authored
Apr 04, 2019
by
hannahhoward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(network): remove buffer
Remove an unneccessary buffer based on an upstream fix - see bitswap/103
parent
c932f96f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
network/libp2p_impl.go
network/libp2p_impl.go
+1
-9
No files found.
network/libp2p_impl.go
View file @
45f5c8cb
package
network
import
(
"bufio"
"context"
"fmt"
"io"
...
...
@@ -64,11 +63,9 @@ func msgToStream(ctx context.Context, s inet.Stream, msg gsmsg.GraphSyncMessage)
log
.
Warningf
(
"error setting deadline: %s"
,
err
)
}
w
:=
bufio
.
NewWriter
(
s
)
switch
s
.
Protocol
()
{
case
ProtocolGraphsync
:
if
err
:=
msg
.
ToNet
(
w
);
err
!=
nil
{
if
err
:=
msg
.
ToNet
(
s
);
err
!=
nil
{
log
.
Debugf
(
"error: %s"
,
err
)
return
err
}
...
...
@@ -76,11 +73,6 @@ func msgToStream(ctx context.Context, s inet.Stream, msg gsmsg.GraphSyncMessage)
return
fmt
.
Errorf
(
"unrecognized protocol on remote: %s"
,
s
.
Protocol
())
}
if
err
:=
w
.
Flush
();
err
!=
nil
{
log
.
Debugf
(
"error: %s"
,
err
)
return
err
}
if
err
:=
s
.
SetWriteDeadline
(
time
.
Time
{});
err
!=
nil
{
log
.
Warningf
(
"error resetting deadline: %s"
,
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