mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-27 17:05:49 +00:00
various minor fixes in gateway initialization
This commit is contained in:
+6
-1
@@ -41,6 +41,10 @@ struct uwsgi_gateway *register_gateway(char *name, void (*loop) (int, void *), v
|
||||
return ug;
|
||||
}
|
||||
|
||||
static void gateway_brutal_end() {
|
||||
_exit(UWSGI_END_CODE);
|
||||
}
|
||||
|
||||
void gateway_respawn(int id) {
|
||||
|
||||
pid_t gw_pid;
|
||||
@@ -65,6 +69,7 @@ void gateway_respawn(int id) {
|
||||
}
|
||||
#endif
|
||||
uwsgi.mypid = getpid();
|
||||
atexit(gateway_brutal_end);
|
||||
signal(SIGALRM, SIG_IGN);
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
signal(SIGINT, end_me);
|
||||
@@ -77,7 +82,7 @@ void gateway_respawn(int id) {
|
||||
|
||||
ug->loop(id, ug->data);
|
||||
// never here !!! (i hope)
|
||||
exit(1);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
ug->pid = gw_pid;
|
||||
|
||||
@@ -834,23 +834,7 @@ void uwsgi_corerouter_loop(int id, void *data) {
|
||||
}
|
||||
|
||||
// not having a hook could mean a previous event in the loop cleared it...
|
||||
if (!hook) {
|
||||
// a single event cannot be unexpected..
|
||||
if (nevents == 1) {
|
||||
if (interesting_fd == cr_session->instance_fd) {
|
||||
uwsgi_log("[uwsgi-corerouter] BUG, unexpected event received from backend instance (fd: %d nevents: %d) !!!\n", interesting_fd, nevents);
|
||||
}
|
||||
else if (interesting_fd == cr_session->fd) {
|
||||
uwsgi_log("[uwsgi-corerouter] BUG, unexpected event received from client (fd: %d nevents: %d)!!!\n", interesting_fd, nevents);
|
||||
}
|
||||
else {
|
||||
uwsgi_log("[uwsgi-corerouter] BUG, unexpected event received !!!\n");
|
||||
}
|
||||
corerouter_close_session(ucr, cr_session);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!hook) continue;
|
||||
// reset errno (as we use it for internal signalling)
|
||||
errno = 0;
|
||||
ssize_t ret = hook(cr_session);
|
||||
|
||||
Reference in New Issue
Block a user