mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-10 03:48:34 +00:00
Complete http_shutdown.
This patch frees up some resources allocated in http.c.
* tcp listeners stopped
* tls settings freed
* uri redirects freed
* unregister internal http.c uri's
(closes issue ASTERISK-22237)
Reported by: Corey Farrell
Patches:
http.patch uploaded by Corey Farrell (license 5909)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@397308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
18
main/http.c
18
main/http.c
@@ -1238,7 +1238,25 @@ static struct ast_cli_entry cli_http[] = {
|
||||
|
||||
static void http_shutdown(void)
|
||||
{
|
||||
struct http_uri_redirect *redirect;
|
||||
ast_cli_unregister_multiple(cli_http, ARRAY_LEN(cli_http));
|
||||
|
||||
ast_tcptls_server_stop(&http_desc);
|
||||
if (http_tls_cfg.enabled) {
|
||||
ast_tcptls_server_stop(&https_desc);
|
||||
}
|
||||
ast_free(http_tls_cfg.certfile);
|
||||
ast_free(http_tls_cfg.pvtfile);
|
||||
ast_free(http_tls_cfg.cipher);
|
||||
|
||||
ast_http_uri_unlink(&statusuri);
|
||||
ast_http_uri_unlink(&staticuri);
|
||||
|
||||
AST_RWLIST_WRLOCK(&uri_redirects);
|
||||
while ((redirect = AST_RWLIST_REMOVE_HEAD(&uri_redirects, entry))) {
|
||||
ast_free(redirect);
|
||||
}
|
||||
AST_RWLIST_UNLOCK(&uri_redirects);
|
||||
}
|
||||
|
||||
int ast_http_init(void)
|
||||
|
||||
Reference in New Issue
Block a user