Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Jan 3, 2019
1 parent 163fe25 commit ce91e92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions common/buf/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ func (r *BufferedReader) WriteTo(writer io.Writer) (int64, error) {
return nBytes, err
}

// Interrupt implements common.Interruptible.
func (r *BufferedReader) Interrupt() {
common.Interrupt(r.Reader)
}

// Close implements io.Closer.
func (r *BufferedReader) Close() error {
if !r.Buffer.IsEmpty() {
ReleaseMulti(r.Buffer)
r.Buffer = nil
}
return common.Close(r.Reader)
}

Expand Down
2 changes: 1 addition & 1 deletion common/net/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (c *connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
// Close implements net.Conn.Close().
func (c *connection) Close() error {
common.Must(c.done.Close())
common.Close(c.reader)
common.Interrupt(c.reader)
common.Close(c.writer)
if c.onClose != nil {
return c.onClose.Close()
Expand Down

0 comments on commit ce91e92

Please sign in to comment.