• Brad Fitzpatrick's avatar
    net/http: make sure Hijack's bufio.Reader includes pre-read background byte · b2a3b54b
    Brad Fitzpatrick authored
    Previously, if the Hijack called stopped the background read call
    which read a byte, that byte was sitting in memory, buffered, ready to
    be Read by Hijack's returned bufio.Reader, but it wasn't yet in the
    bufio.Reader's buffer itself, so bufio.Reader.Buffered() reported 1
    byte fewer.
    
    This matters for callers who wanted to stitch together any buffered
    data (with bufio.Reader.Peek(bufio.Reader.Buffered())) with Hijack's
    returned net.Conn. Otherwise there was no way for callers to know a
    byte was read.
    
    Change-Id: Id7cb0a0a33fe2f33d79250e13dbaa9c0f7abba13
    Reviewed-on: https://go-review.googlesource.com/35232
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarJoe Tsai <thebrokentoaster@gmail.com>
    b2a3b54b
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...
robots.txt Loading commit data...