mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
simplify ray stream
This commit is contained in:
@@ -105,8 +105,7 @@ func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, diale
|
||||
}
|
||||
|
||||
requestDone := signal.ExecuteAsync(func() error {
|
||||
mergedInput := buf.NewMergingReader(outboundRay.OutboundInput())
|
||||
if err := buf.PipeUntilEOF(timer, mergedInput, bodyWriter); err != nil {
|
||||
if err := buf.PipeUntilEOF(timer, outboundRay.OutboundInput(), bodyWriter); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user