mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-13 04:23:54 +08:00
bug fix: null bulk reply bytes
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
nullBulkReplyBytes = []byte("$-1")
|
|
||||||
|
|
||||||
// CRLF is the line separator of redis serialization protocol
|
// CRLF is the line separator of redis serialization protocol
|
||||||
CRLF = "\r\n"
|
CRLF = "\r\n"
|
||||||
@@ -30,7 +29,7 @@ func MakeBulkReply(arg []byte) *BulkReply {
|
|||||||
// ToBytes marshal redis.Reply
|
// ToBytes marshal redis.Reply
|
||||||
func (r *BulkReply) ToBytes() []byte {
|
func (r *BulkReply) ToBytes() []byte {
|
||||||
if len(r.Arg) == 0 {
|
if len(r.Arg) == 0 {
|
||||||
return nullBulkReplyBytes
|
return nullBulkBytes
|
||||||
}
|
}
|
||||||
return []byte("$" + strconv.Itoa(len(r.Arg)) + CRLF + string(r.Arg) + CRLF)
|
return []byte("$" + strconv.Itoa(len(r.Arg)) + CRLF + string(r.Arg) + CRLF)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user