X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver_container.cc;h=113f085c9ff113b3880278defbe3e3ab927832e4;hb=15d1646b2048caffbfaf2b7562665d38afe92688;hp=13b8957339d02e71cb48fc0108cbb944006216f5;hpb=f47caf2833675cce0b62a6e4ffd6764c1490a8b4;p=awesomized%2Flibmemcached diff --git a/libtest/server_container.cc b/libtest/server_container.cc index 13b89573..113f085c 100644 --- a/libtest/server_container.cc +++ b/libtest/server_container.cc @@ -34,7 +34,7 @@ * */ -#include +#include "mem_config.h" #include #include @@ -259,22 +259,18 @@ bool server_startup_st::start_server(const std::string& server_type, in_port_t t } } } - else if (server_type.compare("memcached-light") == 0) - { - if (MEMCACHED_LIGHT_BINARY) - { - if (HAVE_LIBMEMCACHED) - { - server= build_memcached_light("localhost", try_port); - } - } - } if (server == NULL) { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "Launching of an unknown server was attempted: %s", server_type.c_str()); } + } + catch (...) + { + throw; + } + try { /* We will now cycle the server we have created. */ @@ -296,26 +292,30 @@ bool server_startup_st::start_server(const std::string& server_type, in_port_t t } else #endif + if (server->start() == false) - { - delete server; - return false; - } - else - { - if (opt_startup_message) { - Outn(); - Out << "STARTING SERVER(pid:" << server->pid() << "): " << server->running(); - Outn(); + delete server; + return false; + } + else + { + if (opt_startup_message) + { + Outn(); + Out << "STARTING SERVER(pid:" << server->pid() << "): " << server->running(); + Outn(); + } } - } } - catch (libtest::disconnected err) + catch (libtest::disconnected& err) { - stream::cerr(err.file(), err.line(), err.func()) << err.what(); - delete server; - return false; + if (fatal::is_disabled() == false and try_port != LIBTEST_FAIL_PORT) + { + stream::cerr(err.file(), err.line(), err.func()) << err.what(); + delete server; + return false; + } } catch (...) { @@ -343,24 +343,6 @@ bool server_startup_st::start_socket_server(const std::string& server_type, cons { Error << "Socket files are not supported for gearmand yet"; } - else if (server_type.compare("memcached-sasl") == 0) - { - if (MEMCACHED_SASL_BINARY) - { - if (HAVE_LIBMEMCACHED) - { - server= build_memcached_sasl_socket("localhost", try_port, username(), password()); - } - else - { - Error << "Libmemcached was not found"; - } - } - else - { - Error << "No memcached binary is available"; - } - } else if (server_type.compare("memcached") == 0) { if (MEMCACHED_BINARY)