mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 18:55:19 +00:00 
			
		
		
		
	Fix little SIP header continuation issue
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -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;  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user