Commit d9a8d81e authored by Steven Allen's avatar Steven Allen

transport refactor update

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent cd5778a0
......@@ -54,7 +54,7 @@ type streamMessageSender struct {
}
func (s *streamMessageSender) Close() error {
return s.s.Close()
return inet.FullClose(s.s)
}
func (s *streamMessageSender) Reset() error {
......@@ -119,13 +119,13 @@ func (bsnet *impl) SendMessage(
return err
}
err = msgToStream(ctx, s, outgoing)
if err != nil {
if err = msgToStream(ctx, s, outgoing); err != nil {
s.Reset()
} else {
s.Close()
return err
}
return err
// Yes, return this error. We have no reason to believe that the block
// was actually *sent* unless we see the EOF.
return inet.FullClose(s)
}
func (bsnet *impl) SetDelegate(r Receiver) {
......
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