2
0

Only store Conn's *bufio.Reader in msgReader

Confusing and redundant to have the same *bufio.Reader in msgReader
and Conn.
This commit is contained in:
Jack Christensen
2017-02-09 19:37:23 -06:00
parent 72b6d32e2f
commit b8fdc38fa8
2 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -289,7 +289,7 @@ func (rc *ReplicationConn) WaitForReplicationMessage(timeout time.Duration) (r *
}
// Wait until there is a byte available before continuing onto the normal msg reading path
_, err = rc.c.reader.Peek(1)
_, err = rc.c.mr.reader.Peek(1)
if err != nil {
rc.c.conn.SetReadDeadline(zeroTime) // we can only return one error and we already have one -- so ignore possiple error from SetReadDeadline
if err, ok := err.(*net.OpError); ok && err.Timeout() {