net/http: buffer before chunking
This introduces a buffer between writing from a handler and writing chunks. Further, it delays writing the header until the first full chunk is ready. In the case where the first full chunk is also the final chunk (for small responses), that means we can also compute a Content-Length, which is a nice side effect for certain benchmarks. Fixes #2357 R=golang-dev, dave, minux.ma, rsc, adg, balasanjay CC=golang-dev https://golang.org/cl/6964043
Showing
This diff is collapsed.
Please
register
or
sign in
to comment