X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fmemcached.cc;h=2c150f9048a620fc7dcbf1d0831c624997a0a4d7;hb=20ac79fc8f8999f39b4fb33e55d4a205ce0c9a10;hp=b59dc22fa03c7efed4658828aad5a1dc410b5b96;hpb=ad5cb8f903869065c72bb18bf98af6909189a5a9;p=awesomized%2Flibmemcached diff --git a/libtest/memcached.cc b/libtest/memcached.cc index b59dc22f..2c150f90 100644 --- a/libtest/memcached.cc +++ b/libtest/memcached.cc @@ -34,12 +34,9 @@ * */ -#include "mem_config.h" +#include "libtest/yatlcon.h" -#include - -#include -#include +#include "libtest/common.h" #include #include @@ -217,6 +214,11 @@ bool Memcached::build(size_t argc, const char *argv[]) for (size_t x= 0 ; x < argc ; x++) { + if (argv[x] == NULL) + { + break; + } + add_option(argv[x]); } @@ -225,23 +227,22 @@ bool Memcached::build(size_t argc, const char *argv[]) libtest::Server *build_memcached(const std::string& hostname, const in_port_t try_port) { - return new Memcached(hostname, try_port, false); -} + if (HAVE_MEMCACHED_BINARY) + { + return new Memcached(hostname, try_port, false); + } -libtest::Server *build_memcached_socket(const std::string& socket_file, const in_port_t try_port) -{ - return new Memcached(socket_file, try_port, true); + return NULL; } -libtest::Server *build_memcached_sasl(const std::string& hostname, const in_port_t try_port, const std::string& username, const std::string &password) +libtest::Server *build_memcached_socket(const std::string& socket_file, const in_port_t try_port) { - if (username.empty()) + if (HAVE_MEMCACHED_BINARY) { - return new Memcached(hostname, try_port, false, "memcached", "memcached"); + return new Memcached(socket_file, try_port, true); } - return new Memcached(hostname, try_port, false, username, password); + return NULL; } } // namespace libtest -