X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fgearmand.cc;h=d9dcf19248c719dc84b6b21983f5730d222f9c87;hb=ff3501d8602ddcf33b99d203f4ceb017ac411ce6;hp=8106bec4b0a971f2b3529d5081497c1245b21c8d;hpb=f9b74a208522a12dca6ee9c894c6782920860b88;p=m6w6%2Flibmemcached diff --git a/libtest/gearmand.cc b/libtest/gearmand.cc index 8106bec4..d9dcf192 100644 --- a/libtest/gearmand.cc +++ b/libtest/gearmand.cc @@ -34,15 +34,11 @@ * */ -#include "mem_config.h" +#include "libtest/yatlcon.h" #include #include -#include "util/instance.hpp" -#include "util/operation.hpp" - -using namespace datadifferential; using namespace libtest; #include @@ -71,6 +67,8 @@ public: bool ping() { + reset_error(); + if (out_of_ban_killed()) { return false; @@ -79,7 +77,14 @@ public: SimpleClient client(_hostname, _port); std::string response; - return client.send_message("version", response); + bool ret= client.send_message("version", response); + + if (client.is_error()) + { + error(client.error()); + } + + return ret; } const char *name() @@ -138,6 +143,11 @@ bool Gearmand::build(size_t argc, const char *argv[]) for (size_t x= 0 ; x < argc ; x++) { + if (argv[x] == NULL) + { + break; + } + add_option(argv[x]); } @@ -150,8 +160,13 @@ libtest::Server *build_gearmand(const char *hostname, in_port_t try_port, const { if (binary == NULL) { -#if defined(GEARMAND_BINARY) - binary= GEARMAND_BINARY; +#if defined(HAVE_GEARMAND_BINARY) +# if defined(GEARMAND_BINARY) + if (HAVE_GEARMAND_BINARY) + { + binary= GEARMAND_BINARY; + } +# endif #endif }