X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fdo.cc;h=59f9d5a3ada657c68d74da26837e5d90212fde30;hb=9973d386ac8476cd09cc4d9cf7bd2234a42740c7;hp=9ba513f22c49a5f03789809e3714c9a72c30cfb5;hpb=d9db3f534bc38ea22e83e5529ff93aea4150ab19;p=awesomized%2Flibmemcached diff --git a/libmemcached/do.cc b/libmemcached/do.cc index 9ba513f2..59f9d5a3 100644 --- a/libmemcached/do.cc +++ b/libmemcached/do.cc @@ -85,26 +85,23 @@ memcached_return_t memcached_vdo(memcached_instance_st* instance, ** before they start writing, if there is any data in buffer, clear it out, ** otherwise we might get a partial write. **/ + bool sent_success; if (memcached_is_udp(instance->root)) { - return _vdo_udp(instance, vector, count); + sent_success= memcached_success(rc= _vdo_udp(instance, vector, count)); + } else { + sent_success= memcached_io_writev(instance, vector, count, with_flush); } - - bool sent_success= memcached_io_writev(instance, vector, count, with_flush); if (sent_success == false) { - assert(memcached_last_error(instance->root) == MEMCACHED_SUCCESS); - if (memcached_last_error(instance->root) == MEMCACHED_SUCCESS) - { - assert(memcached_last_error(instance->root) != MEMCACHED_SUCCESS); - return memcached_set_error(*instance, MEMCACHED_WRITE_FAILURE, MEMCACHED_AT); - } - else + rc= memcached_last_error(instance->root); + if (rc == MEMCACHED_SUCCESS) { - rc= memcached_last_error(instance->root); + memcached_set_error(*instance, MEMCACHED_WRITE_FAILURE, MEMCACHED_AT); } + memcached_io_reset(instance); } - else if (memcached_is_replying(instance->root)) + else if (memcached_is_replying(instance->root) && !memcached_is_udp(instance->root)) { memcached_server_response_increment(instance); }