Browse code

topos: disable multiple comma separated values in One Single Via, Record-Route or Route header

emvondo authored on 18/08/2022 17:55:03
Showing 2 changed files
... ...
@@ -676,7 +676,7 @@ int tps_reappend_via(sip_msg_t *msg, tps_data_t *ptsd, str *hbody)
676 676
 {
677 677
 	str hname = str_init("Via");
678 678
 
679
-	if (TPS_SEPERATE_VIA & _tps_separate_hv)
679
+	if (TPS_SPLIT_VIA & _tps_separate_hv)
680 680
 		return tps_reappend_separate_header_values(msg, ptsd, hbody,&hname);
681 681
 
682 682
 	if(tps_add_headers(msg, &hname, hbody, 0)<0) {
... ...
@@ -788,7 +788,7 @@ int tps_reappend_rr(sip_msg_t *msg, tps_data_t *ptsd, str *hbody)
788 788
 {
789 789
 	str hname = str_init("Record-Route");
790 790
 
791
-	if (TPS_SEPERATE_RECORD_ROUTE & _tps_separate_hv)
791
+	if (TPS_SPLIT_RECORD_ROUTE & _tps_separate_hv)
792 792
 		return tps_reappend_separate_header_values(msg, ptsd, hbody,&hname);
793 793
 
794 794
 	if(tps_add_headers(msg, &hname, hbody, 0)<0) {
... ...
@@ -845,7 +845,7 @@ int tps_reappend_route(sip_msg_t *msg, tps_data_t *ptsd, str *hbody, int rev)
845 845
 	trim_zeros_lr(&sb);
846 846
 	trim(&sb);
847 847
 	if(sb.len>0 && sb.s[sb.len-1]==',') sb.len--;
848
-	if (TPS_SEPERATE_ROUTE & _tps_separate_hv)
848
+	if (TPS_SPLIT_ROUTE & _tps_separate_hv)
849 849
 		return tps_reappend_separate_header_values(msg, ptsd, &sb,&hname);
850 850
 	if(tps_add_headers(msg, &hname, &sb, 0)<0) {
851 851
 		return -1;
... ...
@@ -31,9 +31,9 @@
31 31
 
32 32
 #include "../../core/parser/msg_parser.h"
33 33
 
34
-#define TPS_SEPERATE_VIA            (1<<0)
35
-#define TPS_SEPERATE_RECORD_ROUTE   (1<<1)
36
-#define TPS_SEPERATE_ROUTE          (1<<2)
34
+#define TPS_SPLIT_VIA            (1<<0)
35
+#define TPS_SPLIT_RECORD_ROUTE   (1<<1)
36
+#define TPS_SPLIT_ROUTE          (1<<2)
37 37
 
38 38
 int tps_update_hdr_replaces(sip_msg_t *msg);
39 39
 char* tps_msg_update(sip_msg_t *msg, unsigned int *olen);