1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 05:55:20 -05:00

simplify ray stream

This commit is contained in:
Darien Raymond
2017-04-16 09:57:28 +02:00
parent d809973621
commit 2f565bfd5e
9 changed files with 120 additions and 168 deletions

View File

@@ -160,8 +160,7 @@ func (s *Server) handleConnection(ctx context.Context, conn internet.Connection,
return newError("failed to write response").Base(err)
}
mergeReader := buf.NewMergingReader(ray.InboundOutput())
payload, err := mergeReader.Read()
payload, err := ray.InboundOutput().Read()
if err != nil {
return err
}
@@ -174,7 +173,7 @@ func (s *Server) handleConnection(ctx context.Context, conn internet.Connection,
return err
}
if err := buf.PipeUntilEOF(timer, mergeReader, responseWriter); err != nil {
if err := buf.PipeUntilEOF(timer, ray.InboundOutput(), responseWriter); err != nil {
return newError("failed to transport all TCP response").Base(err)
}