X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached_do.c;h=c4bf574f641d8a28d36ce649db884bc20d913c74;hb=8a86b578acc594d37a8638e3e0afba1286c4b6ca;hp=ab229e174a9d7ec645499de65b9efff9b6a6a51f;hpb=758bc213bbf8e00c6f33903c1c845c69f39a1ab0;p=m6w6%2Flibmemcached diff --git a/lib/memcached_do.c b/lib/memcached_do.c index ab229e17..c4bf574f 100644 --- a/lib/memcached_do.c +++ b/lib/memcached_do.c @@ -1,7 +1,7 @@ #include "common.h" -memcached_return memcached_do(memcached_st *ptr, unsigned int server_key, char *command, - size_t command_length, char with_flush) +memcached_return memcached_do(memcached_server_st *ptr, char *command, + size_t command_length, uint8_t with_flush) { memcached_return rc; ssize_t sent_length; @@ -9,19 +9,15 @@ memcached_return memcached_do(memcached_st *ptr, unsigned int server_key, char * WATCHPOINT_ASSERT(command_length); WATCHPOINT_ASSERT(command); - if (ptr->hosts[server_key].cursor_active) - (void)memcached_finish_server(ptr, server_key); - - if ((rc= memcached_connect(ptr, server_key)) != MEMCACHED_SUCCESS) + if ((rc= memcached_connect(ptr)) != MEMCACHED_SUCCESS) return rc; - sent_length= memcached_io_write(ptr, server_key, command, command_length, with_flush); + sent_length= memcached_io_write(ptr, command, command_length, with_flush); if (sent_length == -1 || sent_length != command_length) - { - memcached_quit_server(ptr, server_key); rc= MEMCACHED_WRITE_FAILURE; - } + else + memcached_server_response_increment(ptr); return rc; }