1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 15:36:41 -05:00

warn user when http proxy is not finished properly

This commit is contained in:
Darien Raymond 2017-11-26 15:36:05 +01:00
parent e8901368d7
commit b7d022702e
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -274,7 +274,10 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, wri
requestWriter := buf.NewBufferedWriter(ray.InboundInput())
common.Must(requestWriter.SetBuffered(false))
return request.Write(requestWriter)
if err := request.Write(requestWriter); err != nil {
return newError("failed to write whole request").Base(err).AtWarning()
}
return nil
})
responseDone := signal.ExecuteAsync(func() error {
@ -308,7 +311,7 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, wri
response.Header.Set("Proxy-Connection", "close")
}
if err := response.Write(writer); err != nil {
return newError("failed to write response").Base(err)
return newError("failed to write response").Base(err).AtWarning()
}
return nil
})