Fix problem where hostname would end up with trailing . and be accepted as
[m6w6/libmemcached] / libmemcached / io.c
index d3c5e4b6546e6b040d231c7536b9f22db608db2f..2515dc1ea7c72b5f5e2a42404d3aa11f23233c4f 100644 (file)
@@ -314,7 +314,7 @@ memcached_return_t memcached_io_read(memcached_server_write_instance_st ptr,
             and protocol enforcement happens at memcached_response()
             looking for '\n'. We do not care for UDB which requests 8 bytes
             at once. Generally, this means that connection went away. Since
-            for blocking I/O we do not return 0 and for non-blocking case
+            for blocking I/O we do not return EXIT_SUCCESS and for non-blocking case
             it will return EGAIN if data is not immediatly available.
           */
           WATCHPOINT_STRING("We had a zero length recv()");
@@ -600,7 +600,7 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr,
 
   if (ptr->write_buffer_offset == 0 || (ptr->type == MEMCACHED_CONNECTION_UDP
                                         && ptr->write_buffer_offset == UDP_DATAGRAM_HEADER_LENGTH))
-    return 0;
+    return EXIT_SUCCESS;
 
   /* Looking for memory overflows */
 #if defined(DEBUG)
@@ -619,11 +619,7 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr,
       increment_udp_message_id(ptr);
 
     WATCHPOINT_ASSERT(ptr->fd != -1);
-#if defined(__MACH__) && defined(__APPLE__) || defined(__FreeBSD__)
-    sent_length= send(ptr->fd, local_write_ptr, write_length, 0);
-#else
     sent_length= send(ptr->fd, local_write_ptr, write_length, MSG_NOSIGNAL|MSG_DONTWAIT);
-#endif
     if (sent_length == SOCKET_ERROR)
     {
       ptr->cached_errno= get_socket_errno();