mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
fix #1496
This commit is contained in:
parent
163fe2523e
commit
ce91e92435
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user