]> git.saurik.com Git - redis.git/blobdiff - client-libraries/ruby_2/rubyredis.rb
minor fix for Solaris boxes
[redis.git] / client-libraries / ruby_2 / rubyredis.rb
index ae572bcb597f91863a8929094c712a80584e36b9..ca73d817d91fca08ef4fc6bcb3a6b64feaf1e587 100644 (file)
@@ -28,7 +28,6 @@ class RedisClient
     }
 
     ConvertToBool = lambda{|r| r == 0 ? false : r}
-    ConvertToSet = lambda{|r| Set.new(r)}
 
     ReplyProcessor = {
         "exists" => ConvertToBool,
@@ -41,10 +40,6 @@ class RedisClient
         "del"=> ConvertToBool,
         "renamenx"=> ConvertToBool,
         "expire"=> ConvertToBool,
-        "smembers" => ConvertToSet,
-        "sinter" => ConvertToSet,
-        "sunion" => ConvertToSet,
-        "sdiff" => ConvertToSet,
         "keys" => lambda{|r| r.split(" ")},
         "info" => lambda{|r| 
             info = {}
@@ -121,6 +116,7 @@ class RedisClient
         else
             sock = TCPSocket.new(host, port, 0)
         end
+        sock.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1
 
         # If the timeout is set we set the low level socket options in order
         # to make sure a blocking read will return after the specified number
@@ -157,7 +153,7 @@ class RedisClient
         bulk = nil
         argv[0] = argv[0].to_s.downcase
         argv[0] = Aliases[argv[0]] if Aliases[argv[0]]
-        if BulkCommands[argv[0]]
+        if BulkCommands[argv[0]] and argv.length > 1
             bulk = argv[-1].to_s
             argv[-1] = bulk.length
         end
@@ -236,7 +232,7 @@ class RedisClient
             }
             res
         else
-            raise "Protocol error, got '#{rtype}' as initial reply bye"
+            raise "Protocol error, got '#{rtype}' as initial reply byte"
         end
     end
 end