if (io_listen != NULL) io_remove(io_listen);
if (io_ssl_listen != NULL) io_remove(io_ssl_listen);
+ ssl_proxy_deinit();
+
clients_deinit();
master_deinit();
auth_connection_deinit();
- ssl_proxy_deinit();
-
closelog();
}
};
static SSL_CTX *ssl_ctx;
+static struct hash_table *ssl_proxies;
static void plain_read(struct ssl_proxy *proxy);
static void plain_write(struct ssl_proxy *proxy);
}
main_ref();
+ hash_insert(ssl_proxies, proxy, proxy);
return sfd[1];
}
if (--proxy->refcount > 0)
return TRUE;
+ hash_remove(ssl_proxies, proxy);
+
SSL_free(proxy->ssl);
(void)net_disconnect(proxy->fd_ssl);
keyfile, ssl_last_error());
}
+ ssl_proxies = hash_create(default_pool, default_pool, 0, NULL, NULL);
ssl_initialized = TRUE;
}
+static void ssl_proxy_destroy_hash(void *key __attr_unused__, void *value,
+ void *context __attr_unused__)
+{
+ ssl_proxy_destroy(value);
+}
+
void ssl_proxy_deinit(void)
{
- if (ssl_initialized)
- SSL_CTX_free(ssl_ctx);
+ if (!ssl_initialized)
+ return;
+
+ SSL_CTX_free(ssl_ctx);
+
+ hash_foreach(ssl_proxies, ssl_proxy_destroy_hash, NULL);
+ hash_destroy(ssl_proxies);
}
#endif