From 01a394cf5f6fce03fe111b56dc9f185cdcecf2db Mon Sep 17 00:00:00 2001 From: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> Date: Mon, 26 Sep 2022 01:39:41 +0200 Subject: [PATCH] removeServerName should delete the router --- src/App.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/App.h b/src/App.h index 3a08eb8..cd7e927 100644 --- a/src/App.h +++ b/src/App.h @@ -112,6 +112,12 @@ public: } TemplatedApp &&removeServerName(std::string hostname_pattern) { + + /* This will do for now, would be better if us_socket_context_remove_server_name returned the user data */ + auto *domainRouter = us_socket_context_find_server_name_userdata(SSL, (struct us_socket_context_t *) httpContext, hostname_pattern.c_str()); + if (domainRouter) { + delete domainRouter; + } us_socket_context_remove_server_name(SSL, (struct us_socket_context_t *) httpContext, hostname_pattern.c_str()); return std::move(*this);