1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-22 10:01:50 +03:00

Fix PubSubClient connection pool management.

This commit is contained in:
Vladimir Mihailenco
2012-08-06 17:02:45 +03:00
parent 1d3a223419
commit ee618a6290
2 changed files with 32 additions and 15 deletions

View File

@ -3,7 +3,6 @@ package redis
import (
"errors"
"fmt"
"io"
"strconv"
"github.com/vmihailenco/bufreader"
@ -34,17 +33,19 @@ func ParseReq(rd *bufreader.Reader) ([]string, error) {
if err != nil {
return nil, err
}
if line[0] != '*' {
return []string{string(line)}, nil
}
numReplies, err := strconv.ParseInt(string(line[1:]), 10, 64)
if err != nil {
return nil, err
}
args := make([]string, 0)
for {
for i := int64(0); i < numReplies; i++ {
line, err = rd.ReadLine('\n')
if err != nil {
if err == io.EOF {
break
}
return nil, err
}
if line[0] != '$' {