X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver_container.cc;h=fa98c7399e925c760de902694f380a26b4ebf133;hb=fc21f9b9bc7d55fc4ce9d7a323b9e9173dbbe3ba;hp=6973937bc6f8749de1ef7da815c027336fd1ba0f;hpb=0fa4629adf1b793f0faddf39a4237a5d620ca1da;p=m6w6%2Flibmemcached diff --git a/libtest/server_container.cc b/libtest/server_container.cc index 6973937b..fa98c739 100644 --- a/libtest/server_container.cc +++ b/libtest/server_container.cc @@ -75,7 +75,7 @@ void server_startup_st::push_server(Server *arg) } else { - char port_str[NI_MAXSERV]; + char port_str[NI_MAXSERV]= { 0 }; snprintf(port_str, sizeof(port_str), "%u", int(arg->port())); server_config_string+= "--server="; @@ -142,7 +142,7 @@ bool server_startup_st::shutdown() bool success= true; for (std::vector::iterator iter= servers.begin(); iter != servers.end(); ++iter) { - if ((*iter) and (*iter)->has_pid() and (*iter)->kill() == false) + if ((*iter)->has_pid() and (*iter)->kill() == false) { Error << "Unable to kill:" << *(*iter); success= false; @@ -182,7 +182,7 @@ bool server_startup_st::validate() bool server_startup(server_startup_st& construct, const std::string& server_type, in_port_t try_port, int argc, const char *argv[], const bool opt_startup_message) { - construct.start_server(server_type, try_port, argc, argv, opt_startup_message); + return construct.start_server(server_type, try_port, argc, argv, opt_startup_message); } bool server_startup_st::start_server(const std::string& server_type, in_port_t try_port, int argc, const char *argv[], const bool opt_startup_message) @@ -206,6 +206,16 @@ bool server_startup_st::start_server(const std::string& server_type, in_port_t t } } } + else if (server_type.compare("hostile-gearmand") == 0) + { + if (GEARMAND_BINARY) + { + if (HAVE_LIBGEARMAN) + { + server= build_gearmand("localhost", try_port, "gearmand/hostile_gearmand"); + } + } + } else if (server_type.compare("drizzled") == 0) { if (DRIZZLED_BINARY) @@ -277,17 +287,16 @@ bool server_startup_st::start_server(const std::string& server_type, in_port_t t server->build(argc, argv); +#if 0 if (false) { Out << "Pausing for startup, hit return when ready."; std::string gdb_command= server->base_command(); - std::string options; -#if 0 - Out << "run " << server->args(options); -#endif getchar(); } - else if (server->start() == false) + else +#endif + if (server->start() == false) { delete server; return false; @@ -387,17 +396,18 @@ bool server_startup_st::start_socket_server(const std::string& server_type, cons server->build(argc, argv); +#if 0 if (false) { Out << "Pausing for startup, hit return when ready."; std::string gdb_command= server->base_command(); std::string options; -#if 0 Out << "run " << server->args(options); -#endif getchar(); } - else if (server->start() == false) + else +#endif + if (server->start() == false) { Error << "Failed to start " << *server; delete server;