Descriptionnet/http: read as much as possible (including EOF) during chunked reads
This is the chunked half of https://codereview.appspot.com/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.
Patch Set 1 #Patch Set 2 : diff -r d92b32d188ec https://go.googlecode.com/hg/ #Patch Set 3 : diff -r d92b32d188ec https://go.googlecode.com/hg/ #
Total comments: 3
Patch Set 4 : diff -r d92b32d188ec https://go.googlecode.com/hg/ #Patch Set 5 : diff -r d92b32d188ec https://go.googlecode.com/hg/ #
MessagesTotal messages: 3
|