mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-07 16:35:16 +00:00
better handling error from Pipe()
This commit is contained in:
9 files changed
+51
-36
No files matched your search
@@ -104,7 +104,9 @@ func (this *FreedomConnection) Dispatch(destination v2net.Destination, payload *
|
||||
v2writer := v2io.NewAdaptiveWriter(conn)
|
||||
defer v2writer.Release()
|
||||
|
||||
v2io.Pipe(input, v2writer)
|
||||
if err := v2io.PipeUntilEOF(input, v2writer); err != nil {
|
||||
log.Info("Freedom: Failed to transport all TCP request: ", err)
|
||||
}
|
||||
if tcpConn, ok := conn.(*tcp.RawConnection); ok {
|
||||
tcpConn.CloseWrite()
|
||||
}
|
||||
@@ -121,7 +123,9 @@ func (this *FreedomConnection) Dispatch(destination v2net.Destination, payload *
|
||||
}
|
||||
|
||||
v2reader := v2io.NewAdaptiveReader(reader)
|
||||
v2io.Pipe(v2reader, output)
|
||||
if err := v2io.PipeUntilEOF(v2reader, output); err != nil {
|
||||
log.Info("Freedom: Failed to transport all TCP response: ", err)
|
||||
}
|
||||
v2reader.Release()
|
||||
ray.OutboundOutput().Close()
|
||||
|
||||
|
||||
Reference in new issue
Block a user