X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Futil%2Fping.cc;h=52489b95fdef180a4fd97076bb2d04cb19a96be7;hb=7abcaebdc4c3dd11b779eaef58a7371fb82ae888;hp=37da864925f680b760a6f95f06691c9860aa9d63;hpb=5a65c28db362c4d62419075c5c9e416fd855a9f9;p=m6w6%2Flibmemcached diff --git a/libmemcached/util/ping.cc b/libmemcached/util/ping.cc index 37da8649..52489b95 100644 --- a/libmemcached/util/ping.cc +++ b/libmemcached/util/ping.cc @@ -51,6 +51,16 @@ bool libmemcached_util_ping(const char *hostname, in_port_t port, memcached_retu rc= memcached_version(memc_ptr); } + if (memcached_failed(rc) and rc == MEMCACHED_SOME_ERRORS) + { + memcached_server_instance_st instance= + memcached_server_instance_by_position(memc_ptr, 0); + + if (instance and instance->error_messages) + { + rc= memcached_server_error_return(instance); + } + } memcached_free(memc_ptr); if (ret) @@ -58,5 +68,5 @@ bool libmemcached_util_ping(const char *hostname, in_port_t port, memcached_retu *ret= rc; } - return rc == MEMCACHED_SUCCESS; + return memcached_success(rc); }