Merge up to gearmand.
[m6w6/libmemcached] / libtest / server_container.cc
index 6973937bc6f8749de1ef7da815c027336fd1ba0f..d8ef5d495364ad4c51e42722b3a70faeb20a67ac 100644 (file)
@@ -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<Server *>::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;
@@ -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)