summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorGravatar default2024-01-21 06:14:51 +0100
committerGravatar default2024-01-21 06:14:51 +0100
commitd85113bb1fa66e13fdcfbb1c022b257f1da00ec1 (patch)
treeab40fba2904ad703d06793d2b46a5610dfc13a62 /httpd.c
parentMastoapi: fixed an error the edited_at field. (diff)
downloadpenes-snac2-d85113bb1fa66e13fdcfbb1c022b257f1da00ec1.tar.gz
penes-snac2-d85113bb1fa66e13fdcfbb1c022b257f1da00ec1.tar.xz
penes-snac2-d85113bb1fa66e13fdcfbb1c022b257f1da00ec1.zip
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)
710 xs *shm_name = NULL; 710 xs *shm_name = NULL;
711 sem_t anon_job_sem; 711 sem_t anon_job_sem;
712 712
713 /* setup the server stat structure */
714 p_state = srv_state_op(&shm_name, 0);
715
716 p_state->srv_start_time = time(NULL);
717
718 p_state->use_fcgi = xs_type(xs_dict_get(srv_config, "fastcgi")) == XSTYPE_TRUE;
719
720 address = xs_dict_get(srv_config, "address"); 713 address = xs_dict_get(srv_config, "address");
721 port = xs_number_str(xs_dict_get(srv_config, "port")); 714 port = xs_number_str(xs_dict_get(srv_config, "port"));
722 715
@@ -725,6 +718,13 @@ void httpd(void)
725 return; 718 return;
726 } 719 }
727 720
721 /* setup the server stat structure */
722 p_state = srv_state_op(&shm_name, 0);
723
724 p_state->srv_start_time = time(NULL);
725
726 p_state->use_fcgi = xs_type(xs_dict_get(srv_config, "fastcgi")) == XSTYPE_TRUE;
727
728 p_state->srv_running = 1; 728 p_state->srv_running = 1;
729 729
730 signal(SIGPIPE, SIG_IGN); 730 signal(SIGPIPE, SIG_IGN);