diff options
author | Russell Bryant <russell@russellbryant.com> | 2008-03-04 22:28:03 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2008-03-04 22:28:03 +0000 |
commit | 96e04792bdb8aa2235f6a8b5b1a3e4204b78eacf (patch) | |
tree | d340a050b6e5673fa8f8c5630078850928a93da2 | |
parent | cc55483858c4aa29b36b0b5c4b17e902201f4643 (diff) |
add a destroy API call for a server instance
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | channels/chan_sip.c | 2 | ||||
-rw-r--r-- | include/asterisk/tcptls.h | 7 | ||||
-rw-r--r-- | main/http.c | 2 | ||||
-rw-r--r-- | main/manager.c | 2 | ||||
-rw-r--r-- | main/tcptls.c | 6 |
5 files changed, 16 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9fc627f22..a239e3d14 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2238,7 +2238,7 @@ cleanup: ast_free(me); cleanup2: fclose(ser->f); - ast_free(ser); + ser = ast_tcptls_server_instance_destroy(ser); if (req.socket.lock) { ast_mutex_destroy(req.socket.lock); diff --git a/include/asterisk/tcptls.h b/include/asterisk/tcptls.h index 3d7a2c979..814e433a1 100644 --- a/include/asterisk/tcptls.h +++ b/include/asterisk/tcptls.h @@ -166,4 +166,11 @@ void *ast_make_file_from_fd(void *data); HOOK_T ast_tcptls_server_read(struct ast_tcptls_server_instance *ser, void *buf, size_t count); HOOK_T ast_tcptls_server_write(struct ast_tcptls_server_instance *ser, void *buf, size_t count); +/*! + * \brief Destroy a server instance + * + * \return NULL for convenience + */ +struct ast_tcptls_server_instance *ast_tcptls_server_instance_destroy(struct ast_tcptls_server_instance *i); + #endif /* _ASTERISK_SERVER_H */ diff --git a/main/http.c b/main/http.c index 11db1779c..7588461e2 100644 --- a/main/http.c +++ b/main/http.c @@ -827,7 +827,7 @@ static void *httpd_helper_thread(void *data) done: fclose(ser->f); - ast_free(ser); + ser = ast_tcptls_server_instance_destroy(ser); return NULL; } diff --git a/main/manager.c b/main/manager.c index ec8362b08..f8267a4ca 100644 --- a/main/manager.c +++ b/main/manager.c @@ -2882,7 +2882,7 @@ static void *session_do(void *data) destroy_session(s); done: - ast_free(ser); + ser = ast_tcptls_server_instance_destroy(ser); return NULL; } diff --git a/main/tcptls.c b/main/tcptls.c index d623420a5..658ab25ee 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -446,3 +446,9 @@ void *ast_make_file_from_fd(void *data) else return ser; } + +struct ast_tcptls_server_instance *ast_tcptls_server_instance_destroy(struct ast_tcptls_server_instance *i) +{ + ast_free(i); + return NULL; +} |