FossilOrigin-Name: 2cad6235808b58a0041bad16b9bf72102dcfd797023686b28b2a17a6fcd25be0
This commit is contained in:
nekobit 2022-07-27 05:26:41 +00:00
parent 588bfc2126
commit eba2a360e0
2 changed files with 8 additions and 23 deletions

View File

@ -55,8 +55,6 @@ static void xs_init (pTHX);
EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
static int terminate = 0;
/*******************
* Path handling *
******************/
@ -183,7 +181,7 @@ static void* cgi_start(void* arg)
FCGX_Request req;
FCGX_InitRequest(&req, 0, 0);
while (!terminate)
while (1)
{
static pthread_mutex_t accept_mutex = PTHREAD_MUTEX_INITIALIZER;
@ -207,20 +205,8 @@ EXTERN_C void xs_init(pTHX)
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
void term(int signum)
{
FCGX_ShutdownPending();
terminate = 1;
}
int main(int argc, char **argv, char **env)
{
struct sigaction action = {
.sa_handler = term
};
sigaction(SIGTERM, &action, NULL);
sigaction(SIGINT, &action, NULL);
// Global init
mastodont_global_curl_init();
FCGX_Init();
@ -252,20 +238,21 @@ int main(int argc, char **argv, char **env)
// Hell, let's not sit around here either
cgi_start(&api);
FCGX_ShutdownPending();
for (unsigned i = 0; i < THREAD_COUNT; ++i)
pthread_join(id[i], NULL);
free_instance_info_cache();
mastodont_cleanup(&api);
mastodont_global_curl_cleanup();
mastodont_cleanup(&api);
cleanup_template_files();
FCGX_ShutdownPending();
for (unsigned i = 0; i < THREAD_COUNT; ++i)
pthread_join(id[i], NULL);
perl_destruct(perl);
perl_free(perl);
PERL_SYS_TERM();
return 4;
return 0;
}

View File

@ -1071,8 +1071,6 @@ void content_status(PATH_ARGS, uint8_t flags)
call_pv("status::content_status", G_SCALAR);
SPAGAIN;
malloc(1024);
// Duplicate so we can free the TMPs
char* dup = savesharedsvpv(POPs);