From: Brian Aker Date: Sat, 12 Feb 2011 06:31:12 +0000 (-0800) Subject: Add assert for remote testing. X-Git-Tag: 0.51~43^2~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d34abf03f393784c300e2957894aaf8b4eedc1f5;p=awesomized%2Flibmemcached Add assert for remote testing. --- diff --git a/libmemcached/io.c b/libmemcached/io.c index 167b3e6b..6ecac245 100644 --- a/libmemcached/io.c +++ b/libmemcached/io.c @@ -12,6 +12,8 @@ #include "common.h" +#include + typedef enum { MEM_READ, MEM_WRITE @@ -617,6 +619,7 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, if (ptr->type == MEMCACHED_CONNECTION_UDP) increment_udp_message_id(ptr); + assert(ptr->fd != -1); sent_length= send(ptr->fd, local_write_ptr, write_length, 0); if (sent_length == SOCKET_ERROR) { @@ -655,6 +658,7 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, return -1; } case ENOTCONN: + case EPIPE: default: fprintf(stderr, "%s:%d (%s)(%s)\n", __FILE__, __LINE__,__func__, strerror(errno));fflush(stdout); memcached_quit_server(ptr, true);