]> git.saurik.com Git - redis.git/blobdiff - client-libraries/ruby_2/rubyredis.rb
Redis git version modified to 0.101 in order to distinguish that from the latest...
[redis.git] / client-libraries / ruby_2 / rubyredis.rb
index 38823206eac34372d2416508dab0bd8c460a8568..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