|
@@ -5,6 +5,7 @@ import (
|
|
|
"io"
|
|
"io"
|
|
|
|
|
|
|
|
"v2ray.com/core"
|
|
"v2ray.com/core"
|
|
|
|
|
+ "v2ray.com/core/common"
|
|
|
"v2ray.com/core/common/buf"
|
|
"v2ray.com/core/common/buf"
|
|
|
"v2ray.com/core/common/errors"
|
|
"v2ray.com/core/common/errors"
|
|
|
"v2ray.com/core/common/log"
|
|
"v2ray.com/core/common/log"
|
|
@@ -146,7 +147,7 @@ func (w *ServerWorker) handleStatusNew(ctx context.Context, meta *FrameMetadata,
|
|
|
rr := s.NewReader(reader)
|
|
rr := s.NewReader(reader)
|
|
|
if err := buf.Copy(rr, s.output); err != nil {
|
|
if err := buf.Copy(rr, s.output); err != nil {
|
|
|
buf.Copy(rr, buf.Discard)
|
|
buf.Copy(rr, buf.Discard)
|
|
|
- pipe.CloseError(s.input)
|
|
|
|
|
|
|
+ common.Interrupt(s.input)
|
|
|
return s.Close()
|
|
return s.Close()
|
|
|
}
|
|
}
|
|
|
return nil
|
|
return nil
|
|
@@ -177,7 +178,7 @@ func (w *ServerWorker) handleStatusKeep(meta *FrameMetadata, reader *buf.Buffere
|
|
|
closingWriter.Close()
|
|
closingWriter.Close()
|
|
|
|
|
|
|
|
drainErr := buf.Copy(rr, buf.Discard)
|
|
drainErr := buf.Copy(rr, buf.Discard)
|
|
|
- pipe.CloseError(s.input)
|
|
|
|
|
|
|
+ common.Interrupt(s.input)
|
|
|
s.Close()
|
|
s.Close()
|
|
|
return drainErr
|
|
return drainErr
|
|
|
}
|
|
}
|
|
@@ -188,8 +189,8 @@ func (w *ServerWorker) handleStatusKeep(meta *FrameMetadata, reader *buf.Buffere
|
|
|
func (w *ServerWorker) handleStatusEnd(meta *FrameMetadata, reader *buf.BufferedReader) error {
|
|
func (w *ServerWorker) handleStatusEnd(meta *FrameMetadata, reader *buf.BufferedReader) error {
|
|
|
if s, found := w.sessionManager.Get(meta.SessionID); found {
|
|
if s, found := w.sessionManager.Get(meta.SessionID); found {
|
|
|
if meta.Option.Has(OptionError) {
|
|
if meta.Option.Has(OptionError) {
|
|
|
- pipe.CloseError(s.input)
|
|
|
|
|
- pipe.CloseError(s.output)
|
|
|
|
|
|
|
+ common.Interrupt(s.input)
|
|
|
|
|
+ common.Interrupt(s.output)
|
|
|
}
|
|
}
|
|
|
s.Close()
|
|
s.Close()
|
|
|
}
|
|
}
|
|
@@ -241,7 +242,7 @@ func (w *ServerWorker) run(ctx context.Context) {
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
if errors.Cause(err) != io.EOF {
|
|
if errors.Cause(err) != io.EOF {
|
|
|
newError("unexpected EOF").Base(err).WriteToLog(session.ExportIDToError(ctx))
|
|
newError("unexpected EOF").Base(err).WriteToLog(session.ExportIDToError(ctx))
|
|
|
- pipe.CloseError(input)
|
|
|
|
|
|
|
+ common.Interrupt(input)
|
|
|
}
|
|
}
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|