aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-18 04:26:22 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-18 04:26:22 +0000
commita5d7d250947ab9171aca3cf377c629ba5b52f66a (patch)
tree2785de7794a57ae1e4a8f659ccc656000edb9c65 /channels
parented0a628d3496a46179103dd08b827c2a6c686b73 (diff)
Fix little SIP header continuation issue
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4290 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 276d3ba60..ef2c9d944 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2517,33 +2517,32 @@ static int lws2sws(char *msgbuf, int len)
}
/* 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;