mirror of
https://github.com/redis/go-redis.git
synced 2025-08-08 23:42:06 +03:00
Fixes issue where a buffer larger than 4096
bytes cannot be read
This commit is contained in:
@@ -55,10 +55,13 @@ func (r *Reader) Reset(rd io.Reader) {
|
||||
}
|
||||
|
||||
func (r *Reader) ReadLine() ([]byte, error) {
|
||||
line, err := r.readLine()
|
||||
if err != nil {
|
||||
line, err := r.rd.ReadBytes('\n')
|
||||
if err != nil && err != io.EOF {
|
||||
return nil, err
|
||||
}
|
||||
if len(line) == 0 {
|
||||
return nil, fmt.Errorf("redis: reply is empty")
|
||||
}
|
||||
if isNilReply(line) {
|
||||
return nil, Nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user