projects
/
awesomized
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
b92ed47
)
testing: check for pid in lib/Server::isListening()
author
Michael Wallner
<mike@php.net>
Tue, 15 Sep 2020 12:01:10 +0000
(14:01 +0200)
committer
Michael Wallner
<mike@php.net>
Tue, 15 Sep 2020 12:01:10 +0000
(14:01 +0200)
testing/lib/Server.cpp
patch
|
blob
|
history
diff --git
a/testing/lib/Server.cpp
b/testing/lib/Server.cpp
index 481a9fd6eb582c3299eb1abfdebeb45f4cb2cf20..2ab4d5b70b29b1f4cc675b36a8f105f6c963a98c 100644
(file)
--- a/
testing/lib/Server.cpp
+++ b/
testing/lib/Server.cpp
@@
-110,12
+110,24
@@
optional<Server::ChildProc> Server::start() {
}
bool Server::isListening() {
}
bool Server::isListening() {
-
Connection conn(socket_or_port)
;
+
MemcachedPtr memc
;
- if (!conn.open()) {
+ if (holds_alternative<string>(socket_or_port)) {
+ if (memcached_server_add_unix_socket(*memc, get<string>(socket_or_port).c_str())) {
+ return false;
+ }
+ } else {
+ if (memcached_server_add(*memc, "localhost", get<int>(socket_or_port))) {
+ return false;
+ }
+ }
+
+ Malloced stat(memcached_stat(*memc, nullptr, nullptr));
+ if (!*stat || !stat->pid || stat->pid != pid) {
return false;
}
return false;
}
- return conn.isOpen();
+
+ return true;
}
bool Server::stop() {
}
bool Server::stop() {