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
95e3edf3
Unverified
Commit
95e3edf3
authored
Apr 18, 2019
by
Hannah Howard
Committed by
GitHub
Apr 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25 from ipfs/minor_fix_from_go_bitswap
fix(network): remove buffer
parents
c932f96f
45f5c8cb
Changes
1
Show 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 @
95e3edf3
package
network
package
network
import
(
import
(
"bufio"
"context"
"context"
"fmt"
"fmt"
"io"
"io"
...
@@ -64,11 +63,9 @@ func msgToStream(ctx context.Context, s inet.Stream, msg gsmsg.GraphSyncMessage)
...
@@ -64,11 +63,9 @@ func msgToStream(ctx context.Context, s inet.Stream, msg gsmsg.GraphSyncMessage)
log
.
Warningf
(
"error setting deadline: %s"
,
err
)
log
.
Warningf
(
"error setting deadline: %s"
,
err
)
}
}
w
:=
bufio
.
NewWriter
(
s
)
switch
s
.
Protocol
()
{
switch
s
.
Protocol
()
{
case
ProtocolGraphsync
:
case
ProtocolGraphsync
:
if
err
:=
msg
.
ToNet
(
w
);
err
!=
nil
{
if
err
:=
msg
.
ToNet
(
s
);
err
!=
nil
{
log
.
Debugf
(
"error: %s"
,
err
)
log
.
Debugf
(
"error: %s"
,
err
)
return
err
return
err
}
}
...
@@ -76,11 +73,6 @@ func msgToStream(ctx context.Context, s inet.Stream, msg gsmsg.GraphSyncMessage)
...
@@ -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
())
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
{
if
err
:=
s
.
SetWriteDeadline
(
time
.
Time
{});
err
!=
nil
{
log
.
Warningf
(
"error resetting deadline: %s"
,
err
)
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