Merge lp:~tangent-org/libmemcached/1.0-build Build: jenkins-Libmemcached-1.0-89
[awesomized/libmemcached] / libtest / server.h
index 2f9fa2f1d0682d6b64b66f0a558159b73703b2ee..c4e7579cf8975b33838b64641f3abb1bb56fa7d9 100644 (file)
 #include <cassert>
 #include <cstdio>
 #include <cstring>
-#include <netdb.h>
-#include <netinet/in.h>
+
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
 #include <string>
 #include <unistd.h>
 #include <vector>
@@ -204,12 +211,25 @@ public:
     _log_file.clear();
   }
 
-  bool args(Application&);
-
   pid_t pid() const;
 
   bool has_pid() const;
 
+  virtual bool has_pid_file() const
+  {
+    return true;
+  }
+
+  const std::string& error()
+  {
+    return _error;
+  }
+
+  void error(std::string arg)
+  {
+    _error= arg;
+  }
+
   virtual bool wait_for_pidfile() const;
 
   bool check_pid(pid_t pid_arg) const
@@ -237,6 +257,16 @@ public:
 
   bool validate();
 
+  void out_of_ban_killed(bool arg)
+  {
+    out_of_ban_killed_= arg;
+  }
+
+  bool out_of_ban_killed()
+  {
+    return out_of_ban_killed_;
+  }
+
 protected:
   bool set_pid_file();
   Options _options;
@@ -249,6 +279,10 @@ private:
   bool set_log_file();
   bool set_socket_file();
   void reset_pid();
+  bool out_of_ban_killed_;
+  bool args(Application&);
+
+  std::string _error;
 };
 
 std::ostream& operator<<(std::ostream& output, const libtest::Server &arg);