X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fstats.cc;h=9e6083e9d841a9f0d6f7425d9ddff3e827e1f33e;hb=9973d386ac8476cd09cc4d9cf7bd2234a42740c7;hp=180b0d982204c3e34b089d78c7428eba3dc8b292;hpb=4032d474f0f6fb97d2607e8b5ea5c21f1588cb55;p=awesomized%2Flibmemcached diff --git a/libmemcached/stats.cc b/libmemcached/stats.cc index 180b0d98..9e6083e9 100644 --- a/libmemcached/stats.cc +++ b/libmemcached/stats.cc @@ -484,6 +484,7 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, { char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE]; protocol_binary_request_stats request= {}; // = {.bytes= {0}}; + memcached_return_t rc; initialize_binary_request(instance, request.message.header); @@ -501,10 +502,9 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, { args, args_length } }; - if (memcached_vdo(instance, vector, 2, true) != MEMCACHED_SUCCESS) + if (memcached_failed(rc = memcached_vdo(instance, vector, 2, true))) { - memcached_io_reset(instance); - return MEMCACHED_WRITE_FAILURE; + return rc; } } else @@ -514,17 +514,16 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, { request.bytes, sizeof(request.bytes) } }; - if (memcached_vdo(instance, vector, 1, true) != MEMCACHED_SUCCESS) + if (memcached_failed(rc = memcached_vdo(instance, vector, 1, true))) { - memcached_io_reset(instance); - return MEMCACHED_WRITE_FAILURE; + return rc; } } memcached_server_response_decrement(instance); while (1) { - memcached_return_t rc= memcached_response(instance, buffer, sizeof(buffer), NULL); + rc= memcached_response(instance, buffer, sizeof(buffer), NULL); if (rc == MEMCACHED_END) { @@ -533,7 +532,6 @@ static memcached_return_t binary_stats_fetch(memcached_stat_st *memc_stat, if (rc != MEMCACHED_SUCCESS) { - memcached_io_reset(instance); return rc; }