--- chan_sip.c 2004-11-16 14:14:42.000000000 -0500 +++ chan_sip.c_lws 2004-11-17 10:28:21.000000000 -0500 @@ -2499,33 +2499,32 @@ } /* Check for end-of-line */ if (msgbuf[h] == '\n') { - /* Check for end-of-message */ + /* Check for end-of-message */ if (h + 1 == len) - break; - /* Check for a continuation line */ - if (msgbuf[h + 1] == ' ') { - /* Merge continuation line */ - h++; + break; + /* Check for a continuation line */ + if (msgbuf[h + 1] == ' ' || msgbuf[h + 1] == '\t') { + /* Merge continuation line */ + h++; + continue; + } + /* Propagate LF and start new line */ + msgbuf[t++] = msgbuf[h++]; + lws = 0; continue; } - /* Propagate LF and start new line */ - msgbuf[t++] = msgbuf[h++]; - lws = 0; - continue; - } - - if (msgbuf[h] == ' ' || msgbuf[h] == '\t') { - if (lws) { - h++; + if (msgbuf[h] == ' ' || msgbuf[h] == '\t') { + if (lws) { + h++; + continue; + } + msgbuf[t++] = msgbuf[h++]; + lws = 1; continue; } msgbuf[t++] = msgbuf[h++]; - lws = 1; - continue; - } - msgbuf[t++] = msgbuf[h++]; - if (lws) - lws = 0; + if (lws) + lws = 0; } msgbuf[t] = '\0'; return t; @@ -7651,8 +7650,7 @@ debug = sip_debug_test_addr(&sin); if (debug) ast_verbose("\n\nSip read: \n%s\n", req.data); - if (pedanticsipchecking) - req.len = lws2sws(req.data, req.len); + req.len = lws2sws(req.data, req.len); parse(&req); if (debug) ast_verbose("%d headers, %d lines\n", req.headers, req.lines);