projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Add new method which allows someone to "take" a value from a result object.
[awesomized/libmemcached]
/
libtest
/
memcached.cc
diff --git
a/libtest/memcached.cc
b/libtest/memcached.cc
index b8838a06a495bd4bbdf8702daf523e1d1953600d..37a3102eab96b448fb3db10e7abbdc2d0c90d59f 100644
(file)
--- a/
libtest/memcached.cc
+++ b/
libtest/memcached.cc
@@
-97,6
+97,7
@@
public:
libtest::Server(host_arg, port_arg,
MEMCACHED_BINARY, is_memcached_libtool(), is_socket_arg)
{
libtest::Server(host_arg, port_arg,
MEMCACHED_BINARY, is_memcached_libtool(), is_socket_arg)
{
+ set_pid_file();
}
virtual const char *sasl() const
}
virtual const char *sasl() const
@@
-114,13
+115,27
@@
public:
return _username;
}
return _username;
}
-
virtual bool has_pid_
file() const
+
bool wait_for_pid
file() const
{
{
- return false;
+ Wait wait(pid(), 4);
+
+ return wait.successful();
}
bool ping()
{
}
bool ping()
{
+#if 0
+ // Memcached is slow to start, so we need to do this
+ if (pid_file().empty() == false)
+ {
+ if (wait_for_pidfile() == false)
+ {
+ Error << "Pidfile was not found:" << pid_file() << " :" << running();
+ return -1;
+ }
+ }
+#endif
+
memcached_return_t rc;
bool ret;
memcached_return_t rc;
bool ret;
@@
-360,7
+375,7
@@
bool Memcached::build(size_t argc, const char *argv[])
add_option(sasl());
}
add_option(sasl());
}
- for (
in
t x= 0 ; x < argc ; x++)
+ for (
size_
t x= 0 ; x < argc ; x++)
{
add_option(argv[x]);
}
{
add_option(argv[x]);
}