Browse code

pv: added missing WS and WSS to $K(key) variable

Daniel-Constantin Mierla authored on 09/06/2021 10:15:38
Showing 1 changed files
... ...
@@ -3628,6 +3628,10 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3628 3628
 
3629 3629
 	switch(in->len)
3630 3630
 	{
3631
+		case 2:
3632
+			if(strncmp(in->s, "WS", 2)==0)
3633
+				sp->pvp.pvn.u.isname.name.n = 6;
3634
+			else goto error;
3631 3635
 		case 3:
3632 3636
 			if(strncmp(in->s, "UDP", 3)==0)
3633 3637
 				sp->pvp.pvn.u.isname.name.n = 2;
... ...
@@ -3635,6 +3639,8 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3635 3639
 				sp->pvp.pvn.u.isname.name.n = 3;
3636 3640
 			else if(strncmp(in->s, "TLS", 3)==0)
3637 3641
 				sp->pvp.pvn.u.isname.name.n = 4;
3642
+			else if(strncmp(in->s, "WSS", 3)==0)
3643
+				sp->pvp.pvn.u.isname.name.n = 7;
3638 3644
 			else goto error;
3639 3645
 		break;
3640 3646
 		case 4:
... ...
@@ -3706,6 +3712,10 @@ int pv_get_K(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
3706 3712
 			return pv_get_uintval(msg, param, res, PROTO_TLS);
3707 3713
 		case 5:
3708 3714
 			return pv_get_uintval(msg, param, res, PROTO_SCTP);
3715
+		case 6:
3716
+			return pv_get_uintval(msg, param, res, PROTO_WS);
3717
+		case 7:
3718
+			return pv_get_uintval(msg, param, res, PROTO_WSS);
3709 3719
 		default:
3710 3720
 			return pv_get_uintval(msg, param, res, AF_INET);
3711 3721
 	}