handler: make a single client instance

This commit is contained in:
Vaxry
2025-04-15 15:26:08 +01:00
parent 9460795c92
commit 7fa7d5f7c0
3 changed files with 21 additions and 6 deletions

View File

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