Add in MSG_DONTWAIT for recv().
authorBrian Aker <brian@tangent.org>
Tue, 14 Jun 2011 20:41:19 +0000 (13:41 -0700)
committerBrian Aker <brian@tangent.org>
Tue, 14 Jun 2011 20:41:19 +0000 (13:41 -0700)
libmemcached/io.cc

index aa7c0ccb4db5f93ec2c944ee09469ba480c49775..fd719d6ee57410d52e2db8249cb8a0af48e8207b 100644 (file)
@@ -182,7 +182,7 @@ static bool repack_input_buffer(memcached_server_write_instance_st ptr)
     ssize_t nr= recv(ptr->fd,
                      ptr->read_ptr + ptr->read_data_length,
                      MEMCACHED_MAX_BUFFER - ptr->read_data_length,
-                     0);
+                     MSG_DONTWAIT);
 
     if (nr > 0)
     {
@@ -261,7 +261,7 @@ memcached_return_t memcached_io_read(memcached_server_write_instance_st ptr,
 
       do
       {
-        data_read= recv(ptr->fd, ptr->read_buffer, MEMCACHED_MAX_BUFFER, 0);
+        data_read= recv(ptr->fd, ptr->read_buffer, MEMCACHED_MAX_BUFFER, MSG_DONTWAIT);
 
         if (data_read == SOCKET_ERROR)
         {