dougm       02/04/08 18:00:52

  Modified:    .        Changes
               src/modules/perl mod_perl.c modperl_global.c
               t/htdocs/includes test.shtml
               t/modules include.t
  Added:       t/htdocs/includes-registry cgipm.pl
  Log:
  fix 'PerlOptions +GlobalRequest' when used within subrequests
  
  Revision  Changes    Path
  1.6       +2 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Changes   7 Apr 2002 22:47:31 -0000       1.5
  +++ Changes   9 Apr 2002 01:00:51 -0000       1.6
  @@ -1,5 +1,7 @@
   =item 1.99_02-dev
   
  +fix 'PerlOptions +GlobalRequest' when used within subrequests [dougm]
  +
   get rid of some "subroutine redefined" warnings in ModPerl::MM that
   show up with newer bleedperls. [dougm]
   
  
  
  
  1.113     +6 -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.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- mod_perl.c        6 Apr 2002 17:42:10 -0000       1.112
  +++ mod_perl.c        9 Apr 2002 01:00:51 -0000       1.113
  @@ -673,6 +673,12 @@
           return DECLINED;
       }
   
  +    /* 
  +     * need to do this incase we are inside a subrequest,
  +     * since header_parser hook is not run in subrequests.
  +     */
  +    modperl_global_request_cfg_set(r);
  +
   #ifdef USE_ITHREADS
       interp = modperl_interp_select(r, r->connection, r->server);
       aTHX = interp->perl;
  
  
  
  1.5       +5 -8      modperl-2.0/src/modules/perl/modperl_global.c
  
  Index: modperl_global.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_global.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- modperl_global.c  5 Dec 2001 19:00:29 -0000       1.4
  +++ modperl_global.c  9 Apr 2002 01:00:52 -0000       1.5
  @@ -15,19 +15,16 @@
   void modperl_global_request_set(request_rec *r)
   {
       MP_dRCFG;
  +    request_rec *old_r = NULL;
  +
  +    /* reset old value, important for subrequests */
  +    (void)modperl_tls_get_request_rec(&old_r);
  +    modperl_tls_reset_cleanup_request_rec(r->pool, old_r);
   
       modperl_tls_set_request_rec(r);
   
       /* so 'PerlOptions +GlobalRequest' doesnt wipe us out */
       MpReqSET_GLOBAL_REQUEST_On(rcfg);
  -
  -    if (r->main) {
  -        /* reset after subrequests */
  -        modperl_tls_reset_cleanup_request_rec(r->pool, r->main);
  -    }
  -    else {
  -        modperl_tls_reset_cleanup_request_rec(r->pool, NULL);
  -    }
   }
   
   void modperl_global_request_obj_set(pTHX_ SV *svr)
  
  
  
  1.2       +2 -0      modperl-2.0/t/htdocs/includes/test.shtml
  
  Index: test.shtml
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/htdocs/includes/test.shtml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- test.shtml        26 Feb 2002 19:10:04 -0000      1.1
  +++ test.shtml        9 Apr 2002 01:00:52 -0000       1.2
  @@ -2,6 +2,8 @@
   
   <!--#include virtual="/includes-registry/test.pl" -->
   
  +<!--#include virtual="/includes-registry/cgipm.pl" -->
  +
   <p align=right>[<a href="../index.html">back</a>]</p>
   
   <!--#include virtual="/includes/footer.shtml" -->
  
  
  
  1.1                  modperl-2.0/t/htdocs/includes-registry/cgipm.pl
  
  Index: cgipm.pl
  ===================================================================
  use CGI ();
  
  my $cgi = CGI->new;
  
  print $cgi->header;
  
  print "cgi.pm\n";
  
  __END__
  
  
  
  1.2       +1 -0      modperl-2.0/t/modules/include.t
  
  Index: include.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/modules/include.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- include.t 26 Feb 2002 19:13:44 -0000      1.1
  +++ include.t 9 Apr 2002 01:00:52 -0000       1.2
  @@ -9,6 +9,7 @@
   my @patterns = (
       'mod_perl mod_include test',
       'Hello World',
  +    'cgi.pm',
       'footer',
   );
   
  
  
  


Reply via email to