dougm 01/10/13 12:11:32
Modified: src/modules/perl mod_perl.c modperl_env.c modperl_env.h
Log:
calculate hash of env keys at startup
Revision Changes Path
1.92 +1 -0 modperl-2.0/src/modules/perl/mod_perl.c
Index: mod_perl.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- mod_perl.c 2001/10/13 19:02:03 1.91
+++ mod_perl.c 2001/10/13 19:11:32 1.92
@@ -333,6 +333,7 @@
Perl_form(aTHX_ "Perl/v%vd", PL_patchlevel));
modperl_mgv_hash_handlers(pconf, s);
modperl_modglobal_hash_keys();
+ modperl_env_hash_keys();
#ifdef USE_ITHREADS
modperl_init_clones(s, pconf);
#endif
1.13 +11 -1 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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- modperl_env.c 2001/09/28 18:34:30 1.12
+++ modperl_env.c 2001/10/13 19:11:32 1.13
@@ -31,13 +31,23 @@
#define MP_ENV_ENT(k,v) \
{ k, sizeof(k)-1, v, sizeof(v)-1, 0 }
-static const modperl_env_ent_t modperl_env_const_vars[] = {
+static modperl_env_ent_t modperl_env_const_vars[] = {
#ifdef MP_COMPAT_1X
MP_ENV_ENT("GATEWAY_INTERFACE", "CGI-Perl/1.1"),
#endif
MP_ENV_ENT("MOD_PERL", MP_VERSION_STRING),
{ NULL }
};
+
+void modperl_env_hash_keys(void)
+{
+ modperl_env_ent_t *ent = modperl_env_const_vars;
+
+ while (ent->key) {
+ PERL_HASH(ent->hash, ent->key, ent->klen);
+ ent++;
+ }
+}
void modperl_env_clear(pTHX)
{
1.9 +2 -0 modperl-2.0/src/modules/perl/modperl_env.h
Index: modperl_env.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_env.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- modperl_env.h 2001/09/28 19:26:37 1.8
+++ modperl_env.h 2001/10/13 19:11:32 1.9
@@ -11,6 +11,8 @@
#define modperl_env_tie(mg_flags) \
MP_magical_tie(ENVHV, mg_flags)
+void modperl_env_hash_keys(void);
+
void modperl_env_clear(pTHX);
void modperl_env_default_populate(pTHX);