summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-01-21 06:14:51 +0100
committerdefault <nobody@localhost>2024-01-21 06:14:51 +0100
commitd85113bb1fa66e13fdcfbb1c022b257f1da00ec1 (patch)
treeab40fba2904ad703d06793d2b46a5610dfc13a62 /httpd.c
parent49d707078b7bd5758bc06fedb03e7e074d2b9586 (diff)
Delay creating the shared memory struct after the socket is successfully created.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/httpd.c b/httpd.c
index 4c6d985..0bdd9bc 100644
--- a/httpd.c
+++ b/httpd.c
@@ -710,13 +710,6 @@ void httpd(void)
xs *shm_name = NULL;
sem_t anon_job_sem;
- /* setup the server stat structure */
- p_state = srv_state_op(&shm_name, 0);
-
- p_state->srv_start_time = time(NULL);
-
- p_state->use_fcgi = xs_type(xs_dict_get(srv_config, "fastcgi")) == XSTYPE_TRUE;
-
address = xs_dict_get(srv_config, "address");
port = xs_number_str(xs_dict_get(srv_config, "port"));
@@ -725,6 +718,13 @@ void httpd(void)
return;
}
+ /* setup the server stat structure */
+ p_state = srv_state_op(&shm_name, 0);
+
+ p_state->srv_start_time = time(NULL);
+
+ p_state->use_fcgi = xs_type(xs_dict_get(srv_config, "fastcgi")) == XSTYPE_TRUE;
+
p_state->srv_running = 1;
signal(SIGPIPE, SIG_IGN);