• Brad Fitzpatrick's avatar
    net/http: conservatively flush Transport request headers by default · 8e5cb0da
    Brad Fitzpatrick authored
    This changes the http.Transport to flush the bufio.Writer between
    writing the request headers and the body.
    
    That wasn't done in the past to minimize the number of TCP packets on
    the wire, but that's just an optimization, and it causes problems when
    servers are waiting for the headers and the client is blocked on
    something before reading the body.
    
    Instead, only do the don't-flush optimization if we know we're not
    going to block, whitelisting a set of common in-memory Request.Body
    types. (the same set of types special-cased by http.NewRequest)
    
    Fixes #22088
    
    Change-Id: I7717750aa6df32dd3eb92d181b45bc7af24b1144
    Reviewed-on: https://go-review.googlesource.com/114316
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Andrew Bonventre <andybons@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAndrew Bonventre <andybons@golang.org>
    8e5cb0da
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
logs.txt Loading commit data...
robots.txt Loading commit data...