[svn-commits] oej: trunk r54806 - in /trunk: ./ channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Feb 16 05:14:54 MST 2007


Author: oej
Date: Fri Feb 16 06:14:53 2007
New Revision: 54806

URL: http://svn.digium.com/view/asterisk?view=rev&rev=54806
Log:
Merged revisions 54787 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r54787 | oej | 2007-02-16 13:06:23 +0100 (Fri, 16 Feb 2007) | 2 lines

Issue #7541 - Handle multipart attachments to SIP messages - even if boundary is quoted.

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=54806&r1=54805&r2=54806
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Feb 16 06:14:53 2007
@@ -4870,6 +4870,7 @@
 	const char *search;
 	char *boundary;
 	unsigned int x;
+	int boundaryisquoted = FALSE;
 
 	content_type = get_header(req, "Content-Type");
 
@@ -4889,14 +4890,23 @@
 		return 0;
 
 	search += 10;
-
 	if (ast_strlen_zero(search))
 		return 0;
+
+	/* If the boundary is quoted with ", remove quote */
+	if (*search == '\"')  {
+		search++;
+		boundaryisquoted = TRUE;
+	}
 
 	/* make a duplicate of the string, with two extra characters
 	   at the beginning */
 	boundary = ast_strdupa(search - 2);
 	boundary[0] = boundary[1] = '-';
+
+	/* Remove final quote */
+	if (boundaryisquoted)
+		boundary[strlen(boundary) - 1] = '\0';
 
 	/* search for the boundary marker, but stop when there are not enough
 	   lines left for it, the Content-Type header and at least one line of



More information about the svn-commits mailing list