Browse code

bug_fix: if fromtag empty, ";tag=" is no longer printed

Jiri Kuthan authored on 25/01/2003 19:56:35
Showing 1 changed files
... ...
@@ -401,7 +401,8 @@ char *build_uac_request_dlg(str* msg,           /* Method */
401 401
 	     /* header field value and body length */
402 402
 	*len +=   to->len + 
403 403
 			((totag && totag->len) ? (TOTAG_LEN + totag->len) : 0) /* To */
404
-		+ from->len + FROMTAG_LEN + fromtag->len             /* From */
404
+		+ from->len +  /* From */
405
+			((fromtag && fromtag->len) ? FROMTAG_LEN + fromtag->len:0)
405 406
 		+ cseq_str_len + 1 + msg->len                        /* CSeq */
406 407
 		+ callid->len                                        /* Call-ID */
407 408
 		+ ((body) ? (content_len_len) : 0)                   /* Content-Length */
... ...
@@ -443,12 +444,14 @@ char *build_uac_request_dlg(str* msg,           /* Method */
443 444
 
444 445
 	     /* From */
445 446
 	t->from.s = w;
446
-	t->from.len = FROM_LEN + from->len + FROMTAG_LEN + fromtag->len;
447
-
447
+	t->from.len = FROM_LEN + from->len;
448 448
 	memapp(w, FROM, FROM_LEN);
449 449
 	memapp(w, from->s, from->len);
450
-	memapp(w, FROMTAG, FROMTAG_LEN);
451
-	memapp(w, fromtag->s, fromtag->len);
450
+  	if (fromtag && fromtag->len ) { 
451
+		t->from.len+= FROMTAG_LEN + fromtag->len;
452
+		memapp(w, FROMTAG, FROMTAG_LEN);
453
+		memapp(w, fromtag->s, fromtag->len);
454
+	}
452 455
 	memapp(w, CRLF, CRLF_LEN);
453 456
 	
454 457
 	     /* CSeq */