X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver_container.cc;h=f658e6ff83e54c9d4537c8f05cff936ba1e59e95;hb=1be0350e7ae7a566896a9fe52863dcc22433fc8a;hp=3315b3bb5a6243a7cdc36929450b1f8d965c62de;hpb=1c012a73c8d584d485924348388c0975cdd71831;p=m6w6%2Flibmemcached diff --git a/libtest/server_container.cc b/libtest/server_container.cc index 3315b3bb..f658e6ff 100644 --- a/libtest/server_container.cc +++ b/libtest/server_container.cc @@ -91,13 +91,14 @@ Server* server_startup_st::pop_server() return tmp; } -bool server_startup_st::shutdown(uint32_t number_of_host) +// host_to_shutdown => host number to shutdown in array +bool server_startup_st::shutdown(uint32_t host_to_shutdown) { - if (servers.size() > number_of_host) + if (servers.size() > host_to_shutdown) { - Server* tmp= servers[number_of_host]; + Server* tmp= servers[host_to_shutdown]; - if (tmp and tmp->has_pid() and tmp->kill() == false) + if (tmp and tmp->kill() == false) { } else { @@ -108,7 +109,7 @@ bool server_startup_st::shutdown(uint32_t number_of_host) return false; } -void server_startup_st::shutdown_and_remove() +void server_startup_st::clear() { for (std::vector::iterator iter= servers.begin(); iter != servers.end(); iter++) { @@ -166,7 +167,7 @@ server_startup_st::server_startup_st() : server_startup_st::~server_startup_st() { - shutdown_and_remove(); + clear(); } bool server_startup_st::validate()