[asterisk-commits] russell: trunk r105804 - in /trunk: channels/ include/asterisk/ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 4 16:28:04 CST 2008
Author: russell
Date: Tue Mar 4 16:28:03 2008
New Revision: 105804
URL: http://svn.digium.com/view/asterisk?view=rev&rev=105804
Log:
add a destroy API call for a server instance
Modified:
trunk/channels/chan_sip.c
trunk/include/asterisk/tcptls.h
trunk/main/http.c
trunk/main/manager.c
trunk/main/tcptls.c
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=105804&r1=105803&r2=105804
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Mar 4 16:28:03 2008
@@ -2238,7 +2238,7 @@
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);
Modified: trunk/include/asterisk/tcptls.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/tcptls.h?view=diff&rev=105804&r1=105803&r2=105804
==============================================================================
--- trunk/include/asterisk/tcptls.h (original)
+++ trunk/include/asterisk/tcptls.h Tue Mar 4 16:28:03 2008
@@ -166,4 +166,11 @@
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 */
Modified: trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/trunk/main/http.c?view=diff&rev=105804&r1=105803&r2=105804
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Tue Mar 4 16:28:03 2008
@@ -827,7 +827,7 @@
done:
fclose(ser->f);
- ast_free(ser);
+ ser = ast_tcptls_server_instance_destroy(ser);
return NULL;
}
Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=105804&r1=105803&r2=105804
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Tue Mar 4 16:28:03 2008
@@ -2882,7 +2882,7 @@
destroy_session(s);
done:
- ast_free(ser);
+ ser = ast_tcptls_server_instance_destroy(ser);
return NULL;
}
Modified: trunk/main/tcptls.c
URL: http://svn.digium.com/view/asterisk/trunk/main/tcptls.c?view=diff&rev=105804&r1=105803&r2=105804
==============================================================================
--- trunk/main/tcptls.c (original)
+++ trunk/main/tcptls.c Tue Mar 4 16:28:03 2008
@@ -446,3 +446,9 @@
else
return ser;
}
+
+struct ast_tcptls_server_instance *ast_tcptls_server_instance_destroy(struct ast_tcptls_server_instance *i)
+{
+ ast_free(i);
+ return NULL;
+}
More information about the asterisk-commits
mailing list