1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00
This commit is contained in:
Darien Raymond 2017-11-20 11:27:33 +01:00
parent ec8f8d4e10
commit 9f146ac7d2
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -167,7 +167,7 @@ func (s *Server) handleConnect(ctx context.Context, request *http.Request, reade
if reader.Buffered() > 0 {
payload := buf.New()
common.Must(payload.Reset(func(b []byte) (int, error) {
return reader.Read(b[:reader.Buffered()])
return reader.Read(b)
}))
if err := ray.InboundInput().WriteMultiBuffer(buf.NewMultiBufferValue(payload)); err != nil {
return err
@ -274,7 +274,7 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, wri
})
responseDone := signal.ExecuteAsync(func() error {
responseReader := bufio.NewReaderSize(buf.NewBufferedReader(ray.InboundOutput()), 2048)
responseReader := bufio.NewReaderSize(buf.NewBufferedReader(ray.InboundOutput()), buf.Size)
response, err := http.ReadResponse(responseReader, request)
if err == nil {
StripHopByHopHeaders(response.Header)