-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing io.ReaderFrom for http1.1 #35
Comments
The io.ReaderFrom is implemented by *net/http.response for HTTP 1.x connections. If the underlying connection is a TCPConn then it uses the optimised sendfile system call (see (*TCPConn).readFrom) which, according to the man page:
Unfortunately this optimisation is not possible because gziphandler has to gzip the response body. There is just no straight path from file descriptor to file descriptor. |
Validation with https://middleware.vet#github.com/NYTimes/gziphandler shows that
GzipResponseWriter
is not implementingio.ReaderFrom
for http1.1Is it possible to implement these only for http1.1 and not for http2 while still reusing response writers?
The text was updated successfully, but these errors were encountered: