aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-26 03:38:32 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-26 03:38:32 +0000
commit5301c2134e9836ff13a03306d3dfa52cbb713ecd (patch)
treed6a3ded41147c48982a29a3d65fd61d91c97f40b /channels
parent88adf19dffc1ff442acd6fd16f7990b6fbdc8642 (diff)
First pass at handling multi-line headers
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2763 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ddf8088cd..086ddce2b 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1934,7 +1934,7 @@ static int sip_register(char *value, int lineno)
static void parse(struct sip_request *req)
{
/* Divide fields by NULL's */
- char *c;
+ char *c, *last = NULL;
int f = 0;
c = req->data;
@@ -1955,9 +1955,18 @@ static void parse(struct sip_request *req)
}
if (f >= SIP_MAX_HEADERS - 1) {
ast_log(LOG_WARNING, "Too many SIP headers...\n");
- } else
- f++;
- req->header[f] = c + 1;
+ } else {
+ if ((c[1] == ' ') || (c[1] == '\t')) {
+ /* Continuation of previous header */
+ if (last) {
+ while(last < c)
+ *(last++) = ' ';
+ }
+ } else {
+ f++;
+ req->header[f] = c + 1;
+ }
+ }
} else if (*c == '\r') {
/* Ignore but eliminate \r's */
*c = 0;