Browse code

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

(cherry picked from commit a8c9d0ae4fbafba89ef12737419037d141eed1d3)

Daniel-Constantin Mierla authored on 09/06/2021 10:15:38
Showing 1 changed files
... ...
@@ -3329,6 +3329,10 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3329 3329
 
3330 3330
 	switch(in->len)
3331 3331
 	{
3332
+		case 2:
3333
+			if(strncmp(in->s, "WS", 2)==0)
3334
+				sp->pvp.pvn.u.isname.name.n = 6;
3335
+			else goto error;
3332 3336
 		case 3:
3333 3337
 			if(strncmp(in->s, "UDP", 3)==0)
3334 3338
 				sp->pvp.pvn.u.isname.name.n = 2;
... ...
@@ -3336,6 +3340,8 @@ int pv_parse_K_name(pv_spec_p sp, str *in)
3336 3340
 				sp->pvp.pvn.u.isname.name.n = 3;
3337 3341
 			else if(strncmp(in->s, "TLS", 3)==0)
3338 3342
 				sp->pvp.pvn.u.isname.name.n = 4;
3343
+			else if(strncmp(in->s, "WSS", 3)==0)
3344
+				sp->pvp.pvn.u.isname.name.n = 7;
3339 3345
 			else goto error;
3340 3346
 		break;
3341 3347
 		case 4:
... ...
@@ -3407,6 +3413,10 @@ int pv_get_K(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
3407 3413
 			return pv_get_uintval(msg, param, res, PROTO_TLS);
3408 3414
 		case 5:
3409 3415
 			return pv_get_uintval(msg, param, res, PROTO_SCTP);
3416
+		case 6:
3417
+			return pv_get_uintval(msg, param, res, PROTO_WS);
3418
+		case 7:
3419
+			return pv_get_uintval(msg, param, res, PROTO_WSS);
3410 3420
 		default:
3411 3421
 			return pv_get_uintval(msg, param, res, AF_INET);
3412 3422
 	}