*
*/
-#include <config.h>
+#include "mem_config.h"
#include <libtest/common.h>
#include <cassert>
return output; // for multiple << operators
}
+#ifdef __GLIBC__
+namespace {
+
+class Buffer
+{
+public:
+ Buffer(char *b) : b_(b) {}
+ ~Buffer() { free(b_); }
+ char* buf() { return b_; }
+private:
+ char *b_;
+};
+
+}
+#endif // __GLIBC__
+
#define MAGIC_MEMORY 123570
Server::Server(const std::string& host_arg, const in_port_t port_arg,
Server::~Server()
{
+ kill();
}
bool Server::check()
_app.use_valgrind();
}
+ out_of_ban_killed(false);
if (args(_app) == false)
{
throw libtest::disconnected(LIBYATL_DEFAULT_PARAM,
}
libtest::release_port(_port);
+
Application::error_t ret;
if (Application::SUCCESS != (ret= _app.run()))
{
continue;
}
+#ifdef __GLIBC__
+ Buffer buf( get_current_dir_name());
+ char *getcwd_buf= buf.buf();
+#else
char buf[PATH_MAX];
char *getcwd_buf= getcwd(buf, sizeof(buf));
+#endif // __GLIBC__
throw libtest::disconnected(LIBYATL_DEFAULT_PARAM,
hostname(), port(),
"Unable to open pidfile in %s for: %s stderr:%s",
}
}
- uint32_t this_wait= 0;
bool pinged= false;
+ uint32_t this_wait= 0;
{
- uint32_t timeout= 20; // This number should be high enough for valgrind startup (which is slow)
+ uint32_t timeout= 40; // This number should be high enough for valgrind startup (which is slow)
uint32_t waited;
uint32_t retry;
- for (waited= 0, retry= 4; ; retry++, waited+= this_wait)
+ for (waited= 0, retry= 7; ; retry++, waited+= this_wait)
{
+ if (_app.check() == false)
+ {
+ break;
+ }
+
if ((pinged= ping()) == true)
{
break;
break;
}
+ Error << "ping(" << _app.pid() << ") wait: " << this_wait << " " << hostname() << ":" << port() << " " << error();
+
this_wait= retry * retry / 3 + 1;
libtest::dream(this_wait, 0);
}
_options.push_back(std::make_pair(arg, std::string()));
}
-void Server::add_option(const std::string& name, const std::string& value)
+void Server::add_option(const std::string& name_, const std::string& value_)
{
- _options.push_back(std::make_pair(name, value));
+ _options.push_back(std::make_pair(name_, value_));
}
bool Server::set_socket_file()