Accept ping requests on the various unix sockets
This commit is contained in:
parent
686d6da799
commit
8631f33809
@ -54,6 +54,10 @@ retry:
|
||||
close(sockd);
|
||||
goto out;
|
||||
}
|
||||
if (!strncasecmp(buf, "ping", 4)) {
|
||||
LOGDEBUG("Listener received ping request");
|
||||
send_unix_msg(sockd, "pong");
|
||||
}
|
||||
close(sockd);
|
||||
goto retry;
|
||||
out:
|
||||
|
||||
@ -455,11 +455,18 @@ retry:
|
||||
}
|
||||
|
||||
buf = recv_unix_msg(sockd);
|
||||
close(sockd);
|
||||
if (!buf) {
|
||||
close(sockd);
|
||||
LOGWARNING("Failed to get message in connector_loop");
|
||||
goto retry;
|
||||
}
|
||||
if (!strncasecmp(buf, "ping", 4)) {
|
||||
LOGDEBUG("Connector received ping request");
|
||||
send_unix_msg(sockd, "pong");
|
||||
close(sockd);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
LOGDEBUG("Connector received message: %s", buf);
|
||||
if (!strncasecmp(buf, "shutdown", 8))
|
||||
goto out;
|
||||
|
||||
@ -89,6 +89,9 @@ retry:
|
||||
if (submit_block(cs, buf + 12))
|
||||
send_proc(&ckp->stratifier, "update");
|
||||
/* FIXME Add logging of block solves */
|
||||
} else if (!strncasecmp(buf, "ping", 4)) {
|
||||
LOGDEBUG("Generator received ping request");
|
||||
send_unix_msg(sockd, "pong");
|
||||
}
|
||||
close(sockd);
|
||||
goto retry;
|
||||
|
||||
@ -669,11 +669,19 @@ retry:
|
||||
|
||||
dealloc(buf);
|
||||
buf = recv_unix_msg(sockd);
|
||||
close(sockd);
|
||||
if (!buf) {
|
||||
LOGWARNING("Failed to get message in strat_loop");
|
||||
close(sockd);
|
||||
LOGWARNING("Failed to get message in stratum_loop");
|
||||
goto retry;
|
||||
}
|
||||
if (!strncasecmp(buf, "ping", 4)) {
|
||||
LOGDEBUG("Stratifier received ping request");
|
||||
send_unix_msg(sockd, "pong");
|
||||
close(sockd);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
close(sockd);
|
||||
LOGDEBUG("Stratifier received request: %s", buf);
|
||||
if (!strncasecmp(buf, "shutdown", 8)) {
|
||||
ret = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user