You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2001/06/27 07:35:56 UTC
cvs commit: modperl-2.0/src/modules/perl modperl_env.c
dougm 01/06/26 22:35:55
Modified: src/modules/perl modperl_env.c
Log:
GATEWAY_INTERFACE needs to be set on each request, since ap_add_cgi_vars() will reset
Revision Changes Path
1.3 +23 -0 modperl-2.0/src/modules/perl/modperl_env.c
Index: modperl_env.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_env.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- modperl_env.c 2001/05/08 18:55:45 1.2
+++ modperl_env.c 2001/06/27 05:35:55 1.3
@@ -20,6 +20,22 @@
SvTAINTED_on(*svp);
}
+typedef struct {
+ const char *key;
+ I32 klen;
+ const char *val;
+ I32 vlen;
+ U32 hash;
+} mp_env_ent_t;
+
+#define MP_ENV_ENT(k,v) \
+{ k, sizeof(k)-1, v, sizeof(v)-1, 0 }
+
+static const mp_env_ent_t mp_env_const_vars[] = {
+ MP_ENV_ENT("GATEWAY_INTERFACE", "CGI-Perl/1.1"),
+ { NULL }
+};
+
static void mp_env_request_populate(pTHX_ request_rec *r)
{
HV *hv = GvHV(PL_envgv);
@@ -37,6 +53,13 @@
mp_env_hv_store(aTHX_ hv, &elts[i]);
}
+ for (i = 0; mp_env_const_vars[i].key; i++) {
+ const mp_env_ent_t *ent = &mp_env_const_vars[i];
+
+ hv_store(hv, ent->key, ent->klen,
+ newSVpvn(ent->val, ent->vlen), ent->hash);
+ }
+
modperl_env_tie(mg_flags);
}