diff options
| author | 2024-01-21 06:14:51 +0100 | |
|---|---|---|
| committer | 2024-01-21 06:14:51 +0100 | |
| commit | d85113bb1fa66e13fdcfbb1c022b257f1da00ec1 (patch) | |
| tree | ab40fba2904ad703d06793d2b46a5610dfc13a62 | |
| parent | Mastoapi: fixed an error the edited_at field. (diff) | |
| download | snac2-d85113bb1fa66e13fdcfbb1c022b257f1da00ec1.tar.gz snac2-d85113bb1fa66e13fdcfbb1c022b257f1da00ec1.tar.xz snac2-d85113bb1fa66e13fdcfbb1c022b257f1da00ec1.zip | |
Delay creating the shared memory struct after the socket is successfully created.
| -rw-r--r-- | httpd.c | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -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); |