Async locking

This commit is contained in:
2023-01-02 17:53:44 +01:00
parent 4b4e7bd257
commit b79c9c710b
3 changed files with 44 additions and 1 deletions

View File

@ -244,12 +244,19 @@ int main(int argc, char *const argv[]) {
}
}
if (async_init() != 0) {
critical("Unable to initialize async thread");
geoip_free();
return 1;
}
proxy_preload();
for (int i = 0; i < NUM_SOCKETS; i++) {
if (listen(sockets[i], LISTEN_BACKLOG) < 0) {
critical("Unable to listen on socket %i", i);
geoip_free();
proxy_unload();
return 1;
}
}
@ -264,7 +271,12 @@ int main(int argc, char *const argv[]) {
async_thread();
warning("Async thread finished");
notice("Goodbye?");
// cleanup
geoip_free();
proxy_unload();
async_free();
return 0;
}