stas        2003/08/05 23:46:35

  Modified:    src/modules/perl mod_perl.c modperl_apache_includes.h
               .        Changes
  Log:
  don't try to read PERL_HASH_SEED env var, where apr_env_get is not
  available (apr < 0.9.3)
  
  Revision  Changes    Path
  1.175     +6 -2      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.174
  retrieving revision 1.175
  diff -u -r1.174 -r1.175
  --- mod_perl.c        30 Jul 2003 12:18:06 -0000      1.174
  +++ mod_perl.c        6 Aug 2003 06:46:35 -0000       1.175
  @@ -25,8 +25,11 @@
   static void modperl_hash_seed_init(apr_pool_t *p) 
   {
   #ifdef MP_NEED_HASH_SEED_FIXUP
  -    char *s;
   
  +/* XXX: not sure how to portably handle env reading for older apr
  + * libs, for now just ignore it */
  +#ifdef APR_VERSION_0_9_3_PLUS
  +    char *s;
       /* check if there is a specific hash seed passed via the env var
        * and if that's the case -- use it */
       apr_status_t rv = apr_env_get(&s, "PERL_HASH_SEED", p);
  @@ -39,7 +42,8 @@
               MP_init_hash_seed_set = TRUE;
           }
       }
  -
  +#endif
  +    
       /* calculate our own random hash seed */
       if (!MP_init_hash_seed_set) {
           apr_uuid_t *uuid = (apr_uuid_t *)safemalloc(sizeof(apr_uuid_t));
  
  
  
  1.25      +16 -1     modperl-2.0/src/modules/perl/modperl_apache_includes.h
  
  Index: modperl_apache_includes.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_apache_includes.h,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- modperl_apache_includes.h 30 Jul 2003 12:18:06 -0000      1.24
  +++ modperl_apache_includes.h 6 Aug 2003 06:46:35 -0000       1.25
  @@ -20,6 +20,17 @@
   #include "ap_mpm.h"
   
   #include "apr_version.h"
  +
  +/* 2.0.36 is APR_0_9_0-dev */
  +
  +#if APR_MAJOR_VERSION == 0 && APR_MINOR_VERSION == 9 && APR_PATCH_VERSION < 3
  +/* apr < 0.9.3 */
  +#define APR_VERSION_0_9_3_MINUS
  +#else
  +/* apr >= 0.9.3 */
  +#define APR_VERSION_0_9_3_PLUS
  +#endif
  +
   #ifndef APR_POLLIN
   /*
    * apr_poll.h introduced around 2.0.40
  @@ -36,10 +47,14 @@
   #include "apr_network_io.h"
   #include "apr_general.h"
   #include "apr_uuid.h"
  -#include "apr_env.h"
   
   #include "util_filter.h"
   
   #include "util_script.h"
  +
  +
  +#ifdef APR_VERSION_0_9_3_PLUS
  +#include "apr_env.h"
  +#endif
   
   #endif /* MODPERL_APACHE_INCLUDES_H */
  
  
  
  1.202     +6 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.201
  retrieving revision 1.202
  diff -u -r1.201 -r1.202
  --- Changes   30 Jul 2003 12:18:06 -0000      1.201
  +++ Changes   6 Aug 2003 06:46:35 -0000       1.202
  @@ -12,6 +12,12 @@
   
   =item 1.99_10-dev
   
  +don't try to read PERL_HASH_SEED env var, where apr_env_get is not
  +available (apr < 0.9.3) [Stas]
  +
  +APR.so now can be loaded and used outside mod_perl (all the way back
  +to httpd 2.0.36) [Stas]
  +
   perl 5.8.1 randomizes the hash seed, because we precalculate the hash
   values of mgv elements the hash seed has to be the same across all
   perl interpreters. So mod_perl now intercepts cases where perl would
  
  
  

Reply via email to