Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

make it work with redis-cli #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/dotcloud/go-redis-server.png)](https://travis-ci.org/dotcloud/go-redis-server)
[![Build Status](https://travis-ci.org/docker/go-redis-server.png)](https://travis-ci.org/dotcloud/go-redis-server)

Redis server protocol library
=============================
Expand Down
4 changes: 2 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func parseRequest(conn io.ReadCloser) (*Request, error) {

// Multiline request:
if line[0] == '*' {
if _, err := fmt.Sscanf(line, "*%d\r", &argsCount); err != nil {
if _, err := fmt.Sscanf(line, "*%d\r\n", &argsCount); err != nil {
return nil, malformed("*<numberOfArguments>", line)
}
// All next lines are pairs of:
Expand Down Expand Up @@ -71,7 +71,7 @@ func readArgument(r *bufio.Reader) ([]byte, error) {
return nil, malformed("$<argumentLength>", line)
}
var argSize int
if _, err := fmt.Sscanf(line, "$%d\r", &argSize); err != nil {
if _, err := fmt.Sscanf(line, "$%d\r\n", &argSize); err != nil {
return nil, malformed("$<argumentSize>", line)
}

Expand Down