Browse code

pv: removed implementation of $env(name)

Daniel-Constantin Mierla authored on 22/12/2020 18:44:47
Showing 3 changed files
... ...
@@ -227,8 +227,6 @@ static pv_export_t mod_pvs[] = {
227 227
 	{{"duri", (sizeof("duri")-1)}, /* */
228 228
 		PVT_DSTURI, pv_get_dsturi, pv_set_dsturi,
229 229
 		0, 0, 0, 0},
230
-	{{"env", (sizeof("env")-1)}, PVT_OTHER, pv_get_env, 0,
231
-		pv_parse_env_name, 0, 0, 0},
232 230
 	{{"err.class", (sizeof("err.class")-1)}, /* */
233 231
 		PVT_OTHER, pv_get_errinfo_attr, 0,
234 232
 		0, 0, 0, 0},
... ...
@@ -3737,43 +3737,6 @@ int pv_get_ksr_attrs(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
3737 3737
 	}
3738 3738
 }
3739 3739
 
3740
-int pv_parse_env_name(pv_spec_p sp, str *in)
3741
-{
3742
-	char *csname;
3743
-
3744
-	if(in->s==NULL || in->len<=0)
3745
-		return -1;
3746
-
3747
-	csname = pkg_malloc(in->len + 1);
3748
-
3749
-	if (csname == NULL) {
3750
-		LM_ERR("no more pkg memory");
3751
-		return -1;
3752
-	}
3753
-
3754
-	memcpy(csname, in->s, in->len);
3755
-	csname[in->len] = '\0';
3756
-
3757
-	sp->pvp.pvn.u.dname = (void*)csname;
3758
-	sp->pvp.pvn.type = PV_NAME_OTHER;
3759
-	return 0;
3760
-}
3761
-
3762
-int pv_get_env(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
3763
-{
3764
-	char *val;
3765
-	char *csname = (char *) param->pvn.u.dname;
3766
-
3767
-	if (csname) {
3768
-		val = getenv(csname);
3769
-
3770
-		if (val) {
3771
-			return pv_get_strzval(msg, param, res, val);
3772
-		}
3773
-	}
3774
-	return pv_get_null(msg, param, res);
3775
-}
3776
-
3777 3740
 int pv_parse_def_name(pv_spec_p sp, str *in)
3778 3741
 {
3779 3742
 	if (in == NULL || in->s == NULL || sp == NULL) {
... ...
@@ -385,10 +385,6 @@ int pv_parse_msg_attrs_name(pv_spec_p sp, str *in);
385 385
 int pv_get_msg_attrs(sip_msg_t *msg, pv_param_t *param,
386 386
 		pv_value_t *res);
387 387
 
388
-int pv_parse_env_name(pv_spec_p sp, str *in);
389
-
390
-int pv_get_env(sip_msg_t *msg, pv_param_t *param, pv_value_t *res);
391
-
392 388
 int pv_parse_ksr_attrs_name(pv_spec_p sp, str *in);
393 389
 
394 390
 int pv_get_ksr_attrs(sip_msg_t *msg, pv_param_t *param,