[asterisk-commits] dlee: branch 1.8 r397308 - /branches/1.8/main/http.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 21 12:00:09 CDT 2013


Author: dlee
Date: Wed Aug 21 12:00:07 2013
New Revision: 397308

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397308
Log:
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)

Modified:
    branches/1.8/main/http.c

Modified: branches/1.8/main/http.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/http.c?view=diff&rev=397308&r1=397307&r2=397308
==============================================================================
--- branches/1.8/main/http.c (original)
+++ branches/1.8/main/http.c Wed Aug 21 12:00:07 2013
@@ -1238,7 +1238,25 @@
 
 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)




More information about the asterisk-commits mailing list