Commit 45f5c8cb authored by hannahhoward's avatar hannahhoward

fix(network): remove buffer

Remove an unneccessary buffer based on an upstream fix - see bitswap/103
parent c932f96f
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