perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@apache.org
Subject cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
Date Thu, 09 Sep 2004 22:39:11 GMT
gozer       2004/09/09 15:39:11

  Modified:    .        Changes
               lib/Apache PerlSections.pm
               src/modules/perl modperl_config.c modperl_config.h
               xs/Apache/CmdParms Apache__CmdParms.h
               xs/maps  modperl_functions.map
               xs/tables/current/ModPerl FunctionTable.pm
  Log:
  Added Apache::CmdParms::add_config() to work around a memory
  leak discovered with <Perl> sections in .htaccess files
  
  Revision  Changes    Path
  1.481     +3 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.480
  retrieving revision 1.481
  diff -u -r1.480 -r1.481
  --- Changes	9 Sep 2004 22:16:37 -0000	1.480
  +++ Changes	9 Sep 2004 22:39:10 -0000	1.481
  @@ -12,6 +12,9 @@
   
   =item 1.99_17-dev
   
  +Added Apache::CmdParms::add_config() to work around a memory
  +leak discovered with <Perl> sections in .htaccess files [Gozer]
  +
   Added ModPerl::Util::unload_package() to remove a loaded package
   as thoroughly as possible by clearing it's stash. [Gozer]
   
  
  
  
  1.8       +2 -2      modperl-2.0/lib/Apache/PerlSections.pm
  
  Index: PerlSections.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/PerlSections.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PerlSections.pm	23 Aug 2004 21:16:27 -0000	1.7
  +++ PerlSections.pm	9 Sep 2004 22:39:10 -0000	1.8
  @@ -34,7 +34,7 @@
       return bless { @args }, ref($package) || $package;
   }
   
  -sub server     { return shift->{'parms'}->server() }
  +sub parms      { return shift->{'parms'} }
   sub directives { return shift->{'directives'} ||= [] }
   sub package    { return shift->{'args'}->{'package'} }
   
  @@ -200,7 +200,7 @@
   
   sub post_config {
       my($self) = @_;
  -    my $errmsg = $self->server->add_config($self->directives);
  +    my $errmsg = $self->parms->add_config($self->directives);
       die $errmsg if $errmsg;
   }
   
  
  
  
  1.81      +14 -0     modperl-2.0/src/modules/perl/modperl_config.c
  
  Index: modperl_config.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- modperl_config.c	6 Jul 2004 22:06:04 -0000	1.80
  +++ modperl_config.c	9 Sep 2004 22:39:11 -0000	1.81
  @@ -561,6 +561,20 @@
       return errmsg;
   }
   
  +const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms, 
  +                                        SV *lines)
  +{
  +    return modperl_config_insert(aTHX_ 
  +                                 parms->server, 
  +                                 parms->pool, 
  +                                 parms->temp_pool,
  +                                 parms->override, 
  +                                 parms->path,
  +                                 parms->context,
  +                                 lines);
  +}
  +
  +
   const char *modperl_config_insert_server(pTHX_ server_rec *s, SV *lines)
   {
       int override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT);
  
  
  
  1.35      +3 -0      modperl-2.0/src/modules/perl/modperl_config.h
  
  Index: modperl_config.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.h,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- modperl_config.h	6 Jul 2004 22:06:04 -0000	1.34
  +++ modperl_config.h	9 Sep 2004 22:39:11 -0000	1.35
  @@ -130,6 +130,9 @@
                                     ap_conf_vector_t *conf,
                                     SV *lines);
   
  +const char *modperl_config_insert_parms(pTHX_ cmd_parms *parms, 
  +                                        SV *lines);
  +
   const char *modperl_config_insert_server(pTHX_ server_rec *s, SV *lines);
   
   const char *modperl_config_insert_request(pTHX_
  
  
  
  1.4       +9 -0      modperl-2.0/xs/Apache/CmdParms/Apache__CmdParms.h
  
  Index: Apache__CmdParms.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/CmdParms/Apache__CmdParms.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Apache__CmdParms.h	14 Apr 2004 03:41:39 -0000	1.3
  +++ Apache__CmdParms.h	9 Sep 2004 22:39:11 -0000	1.4
  @@ -26,3 +26,12 @@
   
       return &PL_sv_undef;    
   }
  +
  +static MP_INLINE
  +void mpxs_Apache__CmdParms_add_config(pTHX_ cmd_parms *parms, SV *lines)
  +{
  +    const char *errmsg = modperl_config_insert_parms(aTHX_ parms, lines);
  +    if (errmsg) {
  +        Perl_croak(aTHX_ "$parms->add_config() has failed: %s", errmsg);
  +    }
  +}
  
  
  
  1.87      +1 -0      modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- modperl_functions.map	9 Sep 2004 22:16:38 -0000	1.86
  +++ modperl_functions.map	9 Sep 2004 22:39:11 -0000	1.87
  @@ -146,6 +146,7 @@
    ap_check_cmd_context
    ap_method_is_limited
    mpxs_Apache__CmdParms_info
  + mpxs_Apache__CmdParms_add_config
   
   MODULE=Apache::MPM    PACKAGE=Apache::MPM   BOOT=1
    mpxs_Apache__MPM_query
  
  
  
  1.179     +36 -0     modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.178
  retrieving revision 1.179
  diff -u -r1.178 -r1.179
  --- FunctionTable.pm	9 Sep 2004 22:16:38 -0000	1.178
  +++ FunctionTable.pm	9 Sep 2004 22:39:11 -0000	1.179
  @@ -1356,6 +1356,24 @@
     },
     {
       'return_type' => 'const char *',
  +    'name' => 'modperl_config_insert_parms',
  +    'args' => [
  +      {
  +        'type' => 'PerlInterpreter *',
  +        'name' => 'my_perl'
  +      },
  +      {
  +        'type' => 'cmd_parms *',
  +        'name' => 'parms'
  +      },
  +      {
  +        'type' => 'SV *',
  +        'name' => 'lines'
  +      }
  +    ]
  +  },
  +  {
  +    'return_type' => 'const char *',
       'name' => 'modperl_config_insert_request',
       'args' => [
         {
  @@ -5758,6 +5776,24 @@
         {
           'type' => 'apr_uri_t *',
           'name' => 'apr_uri'
  +      }
  +    ]
  +  },
  +  {
  +    'return_type' => 'void',
  +    'name' => 'mpxs_Apache__CmdParms_add_config',
  +    'args' => [
  +      {
  +        'type' => 'PerlInterpreter *',
  +        'name' => 'my_perl'
  +      },
  +      {
  +        'type' => 'cmd_parms *',
  +        'name' => 'parms'
  +      },
  +      {
  +        'type' => 'SV *',
  +        'name' => 'lines'
         }
       ]
     },
  
  
  

Mime
View raw message