commit d85113b

default  ·  2024-01-21 05:14:51 +0000 UTC
parent 49d7070
Delay creating the shared memory struct after the socket is successfully created.
1 files changed,  +7, -7
+7, -7
 1@@ -710,13 +710,6 @@ void httpd(void)
 2     xs *shm_name = NULL;
 3     sem_t anon_job_sem;
 4 
 5-    /* setup the server stat structure */
 6-    p_state = srv_state_op(&shm_name, 0);
 7-
 8-    p_state->srv_start_time = time(NULL);
 9-
10-    p_state->use_fcgi = xs_type(xs_dict_get(srv_config, "fastcgi")) == XSTYPE_TRUE;
11-
12     address = xs_dict_get(srv_config, "address");
13     port    = xs_number_str(xs_dict_get(srv_config, "port"));
14 
15@@ -725,6 +718,13 @@ void httpd(void)
16         return;
17     }
18 
19+    /* setup the server stat structure */
20+    p_state = srv_state_op(&shm_name, 0);
21+
22+    p_state->srv_start_time = time(NULL);
23+
24+    p_state->use_fcgi = xs_type(xs_dict_get(srv_config, "fastcgi")) == XSTYPE_TRUE;
25+
26     p_state->srv_running = 1;
27 
28     signal(SIGPIPE, SIG_IGN);