[asterisk-commits] mmichelson: trunk r168725 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 15 13:00:06 CST 2009


Author: mmichelson
Date: Thu Jan 15 13:00:06 2009
New Revision: 168725

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168725
Log:
Remove an unneeded condition for line addition to a SIP request/response

In Asterisk 1.4 and 1.6.0, the sip_request structure had a statically
allocated buffer to hold the text of the request. There was a check in the
add_line function to not attempt to write the line into the buffer if we
did not have room for it.

In trunk and Asterisk versions starting with 1.6.1, an expandable ast_str
structure is used to hold the text. Since it may grow to fit an arbitrarily
sized string, this check in add_line is no longer valid.

I found this oddity while attempting to fix issue #14220; however, I do not
believe that this is the fix for that issue since the output supplied by the
reporter did not contain the warning message that would be printed had this
condition been satisfied.


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=168725&r1=168724&r2=168725
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu Jan 15 13:00:06 2009
@@ -8085,10 +8085,6 @@
 	if (!req->lines)
 		/* Add extra empty return */
 		req->len += ast_str_append(&req->data, 0, "\r\n");
-	if (req->len >= sizeof(req->data->str) - 4) {
-		ast_log(LOG_WARNING, "Out of space, can't add anymore\n");
-		return -1;
-	}
 	req->line[req->lines] = req->data->str + req->len;
 	ast_str_append(&req->data, 0, "%s", line);
 	req->len += strlen(req->line[req->lines]);




More information about the asterisk-commits mailing list