• Brad Fitzpatrick's avatar
    net/http: buffer before chunking · bef4cb47
    Brad Fitzpatrick authored
    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
    bef4cb47
header.go 4.87 KB