Unverified Commit 95e3edf3 authored by Hannah Howard's avatar Hannah Howard Committed by GitHub

Merge pull request #25 from ipfs/minor_fix_from_go_bitswap

fix(network): remove buffer
parents c932f96f 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)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment