[Asterisk-cvs] asterisk/channels chan_sip.c,1.340,1.341

markster at lists.digium.com markster at lists.digium.com
Sun Apr 25 23:39:18 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv25799/channels

Modified Files:
	chan_sip.c 
Log Message:
Also handle properly \r\n instead of just \n...


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.340
retrieving revision 1.341
diff -u -d -r1.340 -r1.341
--- chan_sip.c	26 Apr 2004 03:41:07 -0000	1.340
+++ chan_sip.c	26 Apr 2004 03:45:10 -0000	1.341
@@ -1936,6 +1936,7 @@
 	/* Divide fields by NULL's */
 	char *c;
 	int f = 0;
+	int lastr = 0;
 	c = req->data;
 
 	/* First header starts immediately */
@@ -1959,15 +1960,21 @@
 				if ((c[1] == ' ') || (c[1] == '\t')) {
 					/* Continuation of previous header */
 					*c = ' ';
+					if (lastr) {
+						*(c-1) = ' ';
+					}
 				} else {
 					f++;
 					req->header[f] = c + 1;
 				}
 			}
+			lastr = 0;
 		} else if (*c == '\r') {
 			/* Ignore but eliminate \r's */
 			*c = 0;
-		}
+			lastr = 1;
+		} else
+			lastr = 0;
 		c++;
 	}
 	/* Check for last header */




More information about the svn-commits mailing list