when expiring stuff, do it on the main process unless we use gdbm.

This commit is contained in:
Nikos Mavrogiannopoulos
2013-02-09 21:13:46 +01:00
parent 184b8d7a66
commit 478c6ca2ce

View File

@@ -689,16 +689,19 @@ fork_failed:
/* Check if we need to expire any cookies */
if (need_maintainance != 0) {
need_maintainance = 0;
pid = fork();
if (pid == 0) { /* child */
setproctitle(PACKAGE_NAME"-maint");
mslog(&s, NULL, LOG_INFO, "Performing maintainance");
clear_lists(&s);
mslog(&s, NULL, LOG_INFO, "Performing maintainance");
expire_tls_sessions(&s);
if (s.config->cookie_db_name != NULL) { /* gdbm */
pid = fork();
if (pid == 0) { /* child */
clear_lists(&s);
setproctitle(PACKAGE_NAME"-maint");
expire_cookies(&s);
exit(0);
}
} else { /* hash */
expire_cookies(&s);
expire_tls_sessions(&s);
exit(0);
}
alarm(MAINTAINANCE_TIME);
}