Browse Source

Add signal detection for responder

Yann Weber 4 years ago
parent
commit
cf25871587
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      src/main.c

+ 7
- 2
src/main.c View File

@@ -42,7 +42,7 @@
42 42
 #include "responder.h"
43 43
 
44 44
 #define IDENT_FMT "pyfcgi[%d]"
45
-#define MAX_REQS 50
45
+#define MAX_REQS 0
46 46
 
47 47
 #define EARLY_ERR(err_str) write(2, err_str, strlen(err_str))
48 48
 
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
89 89
 		}
90 90
 		else if(!child)
91 91
 		{
92
-			responder_loop(py_entrypoint, MAX_REQS, 1, 30);
92
+			responder_loop(py_entrypoint, MAX_REQS, 1, 10);
93 93
 			exit((unsigned char)-1);
94 94
 		}
95 95
 		waitpid(child, &child_ret, 0);
@@ -97,6 +97,11 @@ int main(int argc, char **argv)
97 97
 		{
98 98
 			syslog(LOG_ERR, "Responder loop function exits with error code '%d'",
99 99
 				WEXITSTATUS(child_ret));
100
+			if(WIFSIGNALED(child_ret))
101
+			{
102
+				syslog(LOG_ERR, "Responder loop function terminated by sig '%d'",
103
+					WTERMSIG(child_ret));
104
+			}
100 105
 		}
101 106
 		else
102 107
 		{

Loading…
Cancel
Save