[svn-commits] bebuild: tag 10.11.0-rc2 r377295 - in /tags/10.11.0-rc2: ./ channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 5 11:47:22 CST 2012


Author: bebuild
Date: Wed Dec  5 11:47:19 2012
New Revision: 377295

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377295
Log:
Merge 377258 for 10.11.0-rc2

Removed:
    tags/10.11.0-rc2/asterisk-10.11.0-rc1-summary.html
    tags/10.11.0-rc2/asterisk-10.11.0-rc1-summary.txt
Modified:
    tags/10.11.0-rc2/   (props changed)
    tags/10.11.0-rc2/.version
    tags/10.11.0-rc2/ChangeLog
    tags/10.11.0-rc2/channels/chan_sip.c

Propchange: tags/10.11.0-rc2/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: tags/10.11.0-rc2/
------------------------------------------------------------------------------
    svn:mergeinfo = /branches/10:377258

Modified: tags/10.11.0-rc2/.version
URL: http://svnview.digium.com/svn/asterisk/tags/10.11.0-rc2/.version?view=diff&rev=377295&r1=377294&r2=377295
==============================================================================
--- tags/10.11.0-rc2/.version (original)
+++ tags/10.11.0-rc2/.version Wed Dec  5 11:47:19 2012
@@ -1,1 +1,1 @@
-10.11.0-rc1
+10.11.0-rc2

Modified: tags/10.11.0-rc2/ChangeLog
URL: http://svnview.digium.com/svn/asterisk/tags/10.11.0-rc2/ChangeLog?view=diff&rev=377295&r1=377294&r2=377295
==============================================================================
--- tags/10.11.0-rc2/ChangeLog (original)
+++ tags/10.11.0-rc2/ChangeLog Wed Dec  5 11:47:19 2012
@@ -1,3 +1,23 @@
+2012-12-05  Asterisk Development Team <asteriskteam at digium.com>
+
+	* Asterisk 10.11.0-rc2 Released.
+
+	* Fix a SIP request memory leak with TLS connections.
+
+	During the TLS re-work in chan_sip some TLS specific code was moved
+	into a separate function. This function operates on a copy of the
+	incoming SIP request. This copy was never deinitialized causing a
+	memory leak for each request processed.
+
+	This function is now given a SIP request structure which it can use
+	to copy the incoming request into. This reduces the amount of memory
+	allocations done since the internal allocated components are reused
+	between packets and also ensures the SIP request structure is
+	deinitialized when the TLS connection is torn down.
+
+	(closes issue ASTERISK-20763)
+	Reported by: deti
+
 2012-11-06  Asterisk Development Team <asteriskteam at digium.com>
 
 	* Asterisk 10.11.0-rc1 Released.

Modified: tags/10.11.0-rc2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/tags/10.11.0-rc2/channels/chan_sip.c?view=diff&rev=377295&r1=377294&r2=377295
==============================================================================
--- tags/10.11.0-rc2/channels/chan_sip.c (original)
+++ tags/10.11.0-rc2/channels/chan_sip.c Wed Dec  5 11:47:19 2012
@@ -2537,10 +2537,10 @@
  * \retval -1 Failed to read data
  * \retval 0 Succeeded in reading data
  */
-static int sip_tls_read(struct sip_request *req, struct ast_tcptls_session_instance *tcptls_session, int authenticated, time_t start, struct sip_threadinfo *me)
+static int sip_tls_read(struct sip_request *req, struct sip_request *reqcpy, struct ast_tcptls_session_instance *tcptls_session,
+			int authenticated, time_t start, struct sip_threadinfo *me)
 {
 	int res, content_length, after_poll = 1, need_poll = 1;
-	struct sip_request reqcpy = { 0, };
 	char buf[1024] = "";
 	int timeout = -1;
 
@@ -2594,10 +2594,10 @@
 		}
 		ast_str_append(&req->data, 0, "%s", buf);
 	}
-	copy_request(&reqcpy, req);
-	parse_request(&reqcpy);
+	copy_request(reqcpy, req);
+	parse_request(reqcpy);
 	/* In order to know how much to read, we need the content-length header */
-	if (sscanf(sip_get_header(&reqcpy, "Content-Length"), "%30d", &content_length)) {
+	if (sscanf(sip_get_header(reqcpy, "Content-Length"), "%30d", &content_length)) {
 		while (content_length > 0) {
 			size_t bytes_read;
 			if (!tcptls_session->client && !authenticated) {
@@ -3011,7 +3011,7 @@
 			req.socket.fd = tcptls_session->fd;
 
 			if (tcptls_session->ssl) {
-				res = sip_tls_read(&req, tcptls_session, authenticated, start, me);
+				res = sip_tls_read(&req, &reqcpy, tcptls_session, authenticated, start, me);
 			} else {
 				res = sip_tcp_read(&req, tcptls_session, authenticated, start);
 			}




More information about the svn-commits mailing list