Prechádzať zdrojové kódy

core: add extra params to first via only for generated replies

Daniel-Constantin Mierla 7 mesiacov pred
rodič
commit
9045c8d537
1 zmenil súbory, kde vykonal 5 pridanie a 4 odobranie
  1. 5 4
      src/core/msg_translator.c

+ 5 - 4
src/core/msg_translator.c

@@ -2712,16 +2712,17 @@ char *build_res_buf_from_sip_req(unsigned int code, str *text, str *new_tag,
 								(hdr->body.s + hdr->body.len) - hdr->name.s,
 								msg);
 					}
-					if(received_buf)
+					if(received_buf) {
 						append_str(p, received_buf, received_len);
+					}
+					if(xparams.len > 0) {
+						append_str(p, xparams.s, xparams.len);
+					}
 				} else {
 					/* normal whole via copy */
 					append_str_trans(p, hdr->name.s,
 							(hdr->body.s + hdr->body.len) - hdr->name.s, msg);
 				}
-				if(xparams.len > 0) {
-					append_str(p, xparams.s, xparams.len);
-				}
 				append_str(p, CRLF, CRLF_LEN);
 				/* if is HTTP, replace Via with Sia
 				 * - HTTP Via format is different than SIP Via