Add signal detection for responder

This commit is contained in:
Yann Weber 2019-07-01 14:17:39 +02:00
commit cf25871587

View file

@ -42,7 +42,7 @@
#include "responder.h"
#define IDENT_FMT "pyfcgi[%d]"
#define MAX_REQS 50
#define MAX_REQS 0
#define EARLY_ERR(err_str) write(2, err_str, strlen(err_str))
@ -89,7 +89,7 @@ int main(int argc, char **argv)
}
else if(!child)
{
responder_loop(py_entrypoint, MAX_REQS, 1, 30);
responder_loop(py_entrypoint, MAX_REQS, 1, 10);
exit((unsigned char)-1);
}
waitpid(child, &child_ret, 0);
@ -97,6 +97,11 @@ int main(int argc, char **argv)
{
syslog(LOG_ERR, "Responder loop function exits with error code '%d'",
WEXITSTATUS(child_ret));
if(WIFSIGNALED(child_ret))
{
syslog(LOG_ERR, "Responder loop function terminated by sig '%d'",
WTERMSIG(child_ret));
}
}
else
{