aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-26 03:45:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-26 03:45:10 +0000
commit693599e4e3c5d1f205e08353631f14669c16d017 (patch)
tree4fa909d5aa2aea52fdf2055898821ae3f631a50c /channels
parent1fa096a6b2efbbaca4a637c72c5e21cd156ada05 (diff)
Also handle properly \r\n instead of just \n...
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2765 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 69c03e301..e17f77fc9 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1936,6 +1936,7 @@ static void parse(struct sip_request *req)
/* Divide fields by NULL's */
char *c;
int f = 0;
+ int lastr = 0;
c = req->data;
/* First header starts immediately */
@@ -1959,15 +1960,21 @@ static void parse(struct sip_request *req)
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 */