From: Brian Aker Date: Fri, 11 Feb 2011 21:14:37 +0000 (-0800) Subject: Test location of failure observed on ubuntu hudson X-Git-Tag: 0.51~43^2~11 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=09355b181813d55d406f5346a4600811acd184fb;p=awesomized%2Flibmemcached Test location of failure observed on ubuntu hudson --- diff --git a/libmemcached/io.c b/libmemcached/io.c index bc74af7d..17de8572 100644 --- a/libmemcached/io.c +++ b/libmemcached/io.c @@ -385,7 +385,10 @@ static ssize_t _io_write(memcached_server_write_instance_st ptr, buffer_end= MAX_UDP_DATAGRAM_LENGTH; should_write= length; if (ptr->write_buffer_offset + should_write > buffer_end) + { + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; + } } else { @@ -408,7 +411,10 @@ static ssize_t _io_write(memcached_server_write_instance_st ptr, WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET); sent_length= io_flush(ptr, &rc); if (sent_length == -1) + { + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; + } /* If io_flush calls memcached_purge, sent_length may be 0 */ unlikely (sent_length != 0) @@ -424,6 +430,7 @@ static ssize_t _io_write(memcached_server_write_instance_st ptr, WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET); if (io_flush(ptr, &rc) == -1) { + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; } @@ -574,7 +581,10 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, rc= memcached_purge(ptr); if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_STORED) + { + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; + } } ssize_t sent_length; size_t return_length; @@ -587,7 +597,10 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, // UDP Sanity check, make sure that we are not sending somthing too big if (ptr->type == MEMCACHED_CONNECTION_UDP && write_length > MAX_UDP_DATAGRAM_LENGTH) + { + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; + } if (ptr->write_buffer_offset == 0 || (ptr->type == MEMCACHED_CONNECTION_UDP && ptr->write_buffer_offset == UDP_DATAGRAM_HEADER_LENGTH)) @@ -643,11 +656,13 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, continue; memcached_quit_server(ptr, true); + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; } default: memcached_quit_server(ptr, true); *error= MEMCACHED_ERRNO; + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; } } @@ -656,6 +671,7 @@ static ssize_t io_flush(memcached_server_write_instance_st ptr, (size_t)sent_length != write_length) { memcached_quit_server(ptr, true); + fprintf(stderr, "%s:%d (%s)\n", __FILE__, __LINE__,__func__);fflush(stdout); return -1; }