handler: make client persistent

This commit is contained in:
Vaxry
2025-04-12 23:50:45 +01:00
parent 7e348baf8c
commit 2e48d32a4d
3 changed files with 24 additions and 8 deletions

View File

@@ -82,6 +82,7 @@ int main(int argc, char** argv, char** envp) {
opts.maxRequestSize(g_pConfig->m_config.max_request_size); // 150MB TODO: configurable
endpoint->init(opts);
auto handler = Pistache::Http::make_handler<CServerHandler>();
handler->init();
endpoint->setHandler(handler);
endpoint->serveThreaded();
@@ -110,6 +111,7 @@ int main(int argc, char** argv, char** envp) {
Debug::log(LOG, "Shutting down, bye!");
handler->finish();
endpoint->shutdown();
endpoint = nullptr;