• Brad Fitzpatrick's avatar
    net/http: read as much as possible (including EOF) during chunked reads · ff29be14
    Brad Fitzpatrick authored
    This is the chunked half of https://golang.org/cl/49570044 .
    
    We want full reads to return EOF as early as possible, when we
    know we're at the end, so http.Transport client connections are eagerly
    re-used in the common case, even if no Read or Close follows.
    
    To do this, make the chunkedReader.Read fill up its argument p []byte
    buffer as much as possible, as long as that doesn't involve doing
    any more blocking reads to read chunk headers. That means if we
    have a chunk EOF ("0\r\n") sitting in the incoming bufio.Reader,
    we see it and set EOF on our final Read.
    
    LGTM=adg
    R=adg
    CC=golang-codereviews
    https://golang.org/cl/58240043
    ff29be14
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...