return original_length;
}
-memcached_return memcached_io_close(memcached_server_st *ptr)
+memcached_return memcached_io_close(memcached_server_st *ptr, uint8_t io_death)
{
- close(ptr->fd);
+ /* in case of death shutdown to avoid blocking at close() */
+
+ if (io_death)
+ shutdown(ptr->fd, SHUT_RDWR);
+ else
+ close(ptr->fd);
return MEMCACHED_SUCCESS;
}