From: Trond Norbye Date: Mon, 15 Dec 2008 21:53:54 +0000 (+0100) Subject: memcached_io_reset should disconnect from the server without trying to send a quit... X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=295e847e38375ba6b8669c33264fd46dc3e59feb;p=awesomized%2Flibmemcached memcached_io_reset should disconnect from the server without trying to send a quit command. memcached_response should not call memcached_io_reset when it receives EXISTS Thanks to Robey Pointer for providing a patch. --- diff --git a/libmemcached/memcached_io.c b/libmemcached/memcached_io.c index 2431ac74..6f852893 100644 --- a/libmemcached/memcached_io.c +++ b/libmemcached/memcached_io.c @@ -384,5 +384,5 @@ static ssize_t io_flush(memcached_server_st *ptr, */ void memcached_io_reset(memcached_server_st *ptr) { - memcached_quit_server(ptr, 0); + memcached_quit_server(ptr, 1); } diff --git a/libmemcached/memcached_response.c b/libmemcached/memcached_response.c index 764dbdf0..3a071c14 100644 --- a/libmemcached/memcached_response.c +++ b/libmemcached/memcached_response.c @@ -72,7 +72,7 @@ memcached_return memcached_response(memcached_server_st *ptr, if (total_length >= buffer_length) { memcached_io_reset(ptr); - return MEMCACHED_PROTOCOL_ERROR; + return MEMCACHED_UNKNOWN_READ_FAILURE; } } buffer_ptr++; @@ -154,7 +154,6 @@ memcached_return memcached_response(memcached_server_st *ptr, } else if (buffer[1] == 'X') { - memcached_io_reset(ptr); return MEMCACHED_DATA_EXISTS; } else