Browse Source

Specify what url has been inherited upon restart if possible

master
Con Kolivas 9 years ago
parent
commit
08fcf808a7
  1. 13
      src/ckpool.c

13
src/ckpool.c

@ -1708,6 +1708,7 @@ int main(int argc, char **argv)
if (send_recv_path(path, "ping")) { if (send_recv_path(path, "ping")) {
for (i = 0; i < ckp.serverurls; i++) { for (i = 0; i < ckp.serverurls; i++) {
char oldurl[INET6_ADDRSTRLEN], oldport[8];
char getfd[16]; char getfd[16];
int sockd; int sockd;
@ -1719,10 +1720,16 @@ int main(int argc, char **argv)
break; break;
ckp.oldconnfd[i] = get_fd(sockd); ckp.oldconnfd[i] = get_fd(sockd);
Close(sockd); Close(sockd);
if (!ckp.oldconnfd[i]) sockd = ckp.oldconnfd[i];
if (!sockd)
break; break;
LOGWARNING("Inherited old server socket %d with new file descriptor %d!", if (url_from_socket(sockd, oldurl, oldport)) {
i, ckp.oldconnfd[i]); LOGWARNING("Inherited old server socket %d url %s:%s !",
i, oldurl, oldport);
} else {
LOGWARNING("Inherited old server socket %d with new file descriptor %d!",
i, ckp.oldconnfd[i]);
}
} }
send_recv_path(path, "reject"); send_recv_path(path, "reject");
send_recv_path(path, "reconnect"); send_recv_path(path, "reconnect");

Loading…
Cancel
Save