Commits

carl douglas  committed 8278e9c

Fix protocol error discovered by Matt Gushee on Aug 20, 2012. Put the line feed chomp immediately after the string read.

  • Participants
  • Parent commits 9b81386

Comments (0)

Files changed (2)

File redis-client.scm

            (bulk
              (lambda () (let ((n (single-line-number)))
                           (cond ((equal? n -1)   '())
-                                (else (read-string n port))))))
+                                (else (let ((arg (read-string n port)))
+                                         (read-string 2 port)
+                                          arg))))))
            (next-line
              (lambda () (cond ((equal? argc (length args))  args)
                               ((equal? argc -1)  '())
                             (next-line)))
                    ((#\$) (begin       ; bulk
                             (update-args! (bulk))
-                            (read-string 2 port)
                             (next-line)))
                    (else (error "unrecognised prefix" ch )))))))
     (prefix)))

File tests/run.scm

       '(1))
 (test (redis-hget "hash1" "key")
       '("val"))
+(test (redis-hget "hash1" "nokey")
+      '(()))
 (test (redis-hgetall "hash1")
       '("key" "val"))
 (test (redis-hexists "hash1" "key")