1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

reduce buffer size for http header reading

This commit is contained in:
Darien Raymond 2017-04-18 14:24:34 +02:00
parent 9db86e871e
commit 33ba08be77
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -74,7 +74,7 @@ func isTimeout(err error) bool {
}
func (s *Server) Process(ctx context.Context, network v2net.Network, conn internet.Connection, dispatcher dispatcher.Interface) error {
reader := bufio.NewReaderSize(conn, 8192)
reader := bufio.NewReaderSize(conn, 2048)
Start:
conn.SetReadDeadline(time.Now().Add(time.Second * 16))
@ -234,7 +234,7 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, rea
})
responseDone := signal.ExecuteAsync(func() error {
responseReader := bufio.NewReaderSize(buf.ToBytesReader(ray.InboundOutput()), 8192)
responseReader := bufio.NewReaderSize(buf.ToBytesReader(ray.InboundOutput()), 2048)
response, err := http.ReadResponse(responseReader, request)
if err == nil {
StripHopByHopHeaders(response.Header)