Browse code

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

(cherry picked from commit a8c9d0ae4fbafba89ef12737419037d141eed1d3)
(cherry picked from commit 7b89c5e6abe5f4ae3ee55d9c938c865806f29dec)
(cherry picked from commit e1fb94f5c258038527f8f8df90135d6a4c2a4391)

Daniel-Constantin Mierla authored on 09/06/2021 10:15:38 • Henning Westerholt committed on 22/10/2021 11:57:13
Showing 1 changed files
... ...
@@ -3237,6 +3237,10 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3237 3237
 
3238 3238
 	switch(in->len)
3239 3239
 	{
3240
+		case 2:
3241
+			if(strncmp(in->s, "WS", 2)==0)
3242
+				sp->pvp.pvn.u.isname.name.n = 6;
3243
+			else goto error;
3240 3244
 		case 3:
3241 3245
 			if(strncmp(in->s, "UDP", 3)==0)
3242 3246
 				sp->pvp.pvn.u.isname.name.n = 2;
... ...
@@ -3244,6 +3248,8 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3244 3248
 				sp->pvp.pvn.u.isname.name.n = 3;
3245 3249
 			else if(strncmp(in->s, "TLS", 3)==0)
3246 3250
 				sp->pvp.pvn.u.isname.name.n = 4;
3251
+			else if(strncmp(in->s, "WSS", 3)==0)
3252
+				sp->pvp.pvn.u.isname.name.n = 7;
3247 3253
 			else goto error;
3248 3254
 		break;
3249 3255
 		case 4:
... ...
@@ -3315,6 +3321,10 @@ int pv_get_K(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
3315 3321
 			return pv_get_uintval(msg, param, res, PROTO_TLS);
3316 3322
 		case 5:
3317 3323
 			return pv_get_uintval(msg, param, res, PROTO_SCTP);
3324
+		case 6:
3325
+			return pv_get_uintval(msg, param, res, PROTO_WS);
3326
+		case 7:
3327
+			return pv_get_uintval(msg, param, res, PROTO_WSS);
3318 3328
 		default:
3319 3329
 			return pv_get_uintval(msg, param, res, AF_INET);
3320 3330
 	}