1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Use single read and write buffer where possible

This commit is contained in:
Vladimir Mihailenco
2018-08-04 12:19:19 +03:00
parent ad7024da36
commit b576fe91a1
11 changed files with 368 additions and 106 deletions

View File

@ -246,8 +246,8 @@ func (p *ConnPool) popIdle() *Conn {
}
func (p *ConnPool) Put(cn *Conn) {
buf := cn.Rd.PeekBuffered()
if buf != nil {
buf := cn.Rd.Bytes()
if len(buf) > 0 {
internal.Logf("connection has unread data: %.100q", buf)
p.Remove(cn)
return