1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00
This commit is contained in:
Darien Raymond 2019-01-04 00:24:28 +01:00
parent 163fe2523e
commit ce91e92435
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 6 additions and 5 deletions

View File

@ -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)
}

View File

@ -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()