Remove dead UDP code.
authorBrian Aker <brian@tangent.org>
Thu, 5 Jan 2012 06:16:04 +0000 (22:16 -0800)
committerBrian Aker <brian@tangent.org>
Thu, 5 Jan 2012 06:16:04 +0000 (22:16 -0800)
libmemcached/io.cc

index e7a0627ec4775c38dafd631ee15666478ccea9fe..538f15371688b593179946043db0ae27566d7431 100644 (file)
@@ -579,25 +579,9 @@ static ssize_t _io_write(memcached_server_write_instance_st ptr,
   while (length)
   {
     char *write_ptr;
-    size_t should_write;
-    size_t buffer_end;
-
-    if (memcached_is_udp(ptr->root))
-    {
-      //UDP does not support partial writes
-      buffer_end= MAX_UDP_DATAGRAM_LENGTH;
-      should_write= length;
-      if (ptr->write_buffer_offset + should_write > buffer_end)
-      {
-        return -1;
-      }
-    }
-    else
-    {
-      buffer_end= MEMCACHED_MAX_BUFFER;
-      should_write= buffer_end - ptr->write_buffer_offset;
-      should_write= (should_write < length) ? should_write : length;
-    }
+    size_t buffer_end= MEMCACHED_MAX_BUFFER;
+    size_t should_write= buffer_end -ptr->write_buffer_offset;
+    should_write= (should_write < length) ? should_write : length;
 
     write_ptr= ptr->write_buffer + ptr->write_buffer_offset;
     memcpy(write_ptr, buffer_ptr, should_write);
@@ -605,7 +589,7 @@ static ssize_t _io_write(memcached_server_write_instance_st ptr,
     buffer_ptr+= should_write;
     length-= should_write;
 
-    if (ptr->write_buffer_offset == buffer_end and memcached_is_udp(ptr->root) == false)
+    if (ptr->write_buffer_offset == buffer_end)
     {
       WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);