mirror of
https://github.com/versity/versitygw.git
synced 2026-10-22 06:12:39 +00:00
docs(netutil): correct the comment on handing sniffed bytes to the handshake
The comment claimed the short read's error is carried to the next call. It is not: it is returned when nothing was read, and the next read of the connection produces it again for both EOF and an expired deadline.
This commit is contained in:
@@ -430,8 +430,8 @@ func (c *plaintextHTTPConn) Read(p []byte) (int, error) {
|
||||
return 0, errPlaintextHTTPOnTLS
|
||||
}
|
||||
|
||||
// Hand the sniffed bytes to the handshake and carry a short
|
||||
// read's error over to the next call.
|
||||
// Hand the sniffed bytes to the handshake. After a short read, the
|
||||
// next read of the connection returns the error again.
|
||||
c.prefix = hdr[:n]
|
||||
if err != nil && n == 0 {
|
||||
return 0, err
|
||||
|
||||
Reference in New Issue
Block a user