forked from mirror/redis
internal/proto: use read prefix to indicate that method reads from the stream.
This commit is contained in:
parent
dcdf129dd5
commit
3996289fe2
|
@ -77,7 +77,7 @@ func (p *Reader) ReadReply(m MultiBulkParse) (interface{}, error) {
|
||||||
case IntReply:
|
case IntReply:
|
||||||
return parseIntValue(line)
|
return parseIntValue(line)
|
||||||
case StringReply:
|
case StringReply:
|
||||||
return p.parseBytesValue(line)
|
return p.readBytesValue(line)
|
||||||
case ArrayReply:
|
case ArrayReply:
|
||||||
n, err := parseArrayLen(line)
|
n, err := parseArrayLen(line)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -112,7 +112,7 @@ func (p *Reader) ReadBytesReply() ([]byte, error) {
|
||||||
case ErrorReply:
|
case ErrorReply:
|
||||||
return nil, parseErrorValue(line)
|
return nil, parseErrorValue(line)
|
||||||
case StringReply:
|
case StringReply:
|
||||||
return p.parseBytesValue(line)
|
return p.readBytesValue(line)
|
||||||
case StatusReply:
|
case StatusReply:
|
||||||
return parseStatusValue(line)
|
return parseStatusValue(line)
|
||||||
default:
|
default:
|
||||||
|
@ -206,7 +206,7 @@ func (p *Reader) ReadScanReply() ([]string, uint64, error) {
|
||||||
return keys, cursor, err
|
return keys, cursor, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Reader) parseBytesValue(line []byte) ([]byte, error) {
|
func (p *Reader) readBytesValue(line []byte) ([]byte, error) {
|
||||||
if isNilReply(line) {
|
if isNilReply(line) {
|
||||||
return nil, internal.Nil
|
return nil, internal.Nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue