Browse code

sip: b/f: avoid checking header type more than once in parse_headers()

Should fix the double Contact-HF issue.

Raphael Coeffic authored on 29/11/2013 09:16:52
Showing 1 changed files
... ...
@@ -457,10 +457,11 @@ static int parse_first_line(sip_msg* msg, char** c, char* end)
457 457
 
458 458
 int parse_headers(sip_msg* msg, char** c, char* end)
459 459
 {
460
-    int err = parse_headers(msg->hdrs,c,end);
460
+    list<sip_header*> hdrs;
461
+    int err = parse_headers(hdrs,c,end);
461 462
     if(!err) {
462
-	for(list<sip_header*>::iterator it = msg->hdrs.begin();
463
-	    it != msg->hdrs.end(); ++it) {
463
+	for(list<sip_header*>::iterator it = hdrs.begin();
464
+	    it != hdrs.end(); ++it) {
464 465
 
465 466
 	    sip_header* hdr = *it;
466 467
 	    switch(hdr->type) {
... ...
@@ -519,6 +520,7 @@ int parse_headers(sip_msg* msg, char** c, char* end)
519 520
 		msg->record_route.push_back(hdr);
520 521
 		break;
521 522
 	    }
523
+	    msg->hdrs.push_back(hdr);
522 524
 	}
523 525
     }
524 526