mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 08:46:56 +08:00
rewrite backlog
This commit is contained in:
@@ -156,6 +156,9 @@ func parseBulkString(header []byte, reader *bufio.Reader, ch chan<- *Payload) er
|
||||
func parseRDBBulkString(reader *bufio.Reader, ch chan<- *Payload) error {
|
||||
header, err := reader.ReadBytes('\n')
|
||||
header = bytes.TrimSuffix(header, []byte{'\r', '\n'})
|
||||
if len(header) == 0 {
|
||||
return errors.New("empty header")
|
||||
}
|
||||
strLen, err := strconv.ParseInt(string(header[1:]), 10, 64)
|
||||
if err != nil || strLen <= 0 {
|
||||
return errors.New("illegal bulk header: " + string(header))
|
||||
|
Reference in New Issue
Block a user