perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-2.0 Changes
Date Fri, 09 May 2003 03:33:02 GMT
stas        2003/05/08 20:33:02

  Modified:    src/modules/perl modperl_filter.c modperl_filter.h
               xs/Apache/Filter Apache__Filter.h
               xs/tables/current/ModPerl FunctionTable.pm
               .        Changes
  Log:
  add the modperl_filter magic object to $f in init filter handlers, so
  in addition to $f->ctx, methods like $f->remove can be called
  
  Revision  Changes    Path
  1.63      +15 -5     modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- modperl_filter.c	18 Apr 2003 05:34:12 -0000	1.62
  +++ modperl_filter.c	9 May 2003 03:33:01 -0000	1.63
  @@ -315,6 +315,7 @@
   }
   
   static int modperl_run_filter_init(ap_filter_t *f,
  +                                   modperl_filter_mode_e mode,
                                      modperl_handler_t *handler) 
   {
       AV *args = Nullav;
  @@ -333,8 +334,8 @@
                                 "Apache::Filter", f,
                                 NULL);
   
  -    /* XXX: do we need it? */
  -    /* modperl_filter_mg_set(aTHX_ AvARRAY(args)[0], filter); */
  +    modperl_filter_mg_set(aTHX_ AvARRAY(args)[0],
  +                          modperl_filter_new(f, NULL, mode, 0, 0, 0));
   
       if ((status = modperl_callback(aTHX_ handler, p, r, s, args)) != OK) {
           status = modperl_errsv(aTHX_ status, r, s);
  @@ -827,7 +828,11 @@
   
               if (handlers[i]->attrs & MP_FILTER_HAS_INIT_HANDLER &&
                   handlers[i]->next) {
  -                int status = modperl_run_filter_init(f, handlers[i]->next);
  +                int status = modperl_run_filter_init(
  +                    f,
  +                    (idx == MP_INPUT_FILTER_HANDLER
  +                     ? MP_INPUT_FILTER_MODE : MP_OUTPUT_FILTER_MODE),
  +                    handlers[i]->next);
                   if (status != OK) {
                       return status;
                   }
  @@ -909,7 +914,11 @@
   
               if (handlers[i]->attrs & MP_FILTER_HAS_INIT_HANDLER &&
                   handlers[i]->next) {
  -                int status = modperl_run_filter_init(f, handlers[i]->next);
  +                int status = modperl_run_filter_init(
  +                    f,
  +                    (idx == MP_INPUT_FILTER_HANDLER
  +                     ? MP_INPUT_FILTER_MODE : MP_OUTPUT_FILTER_MODE),
  +                    handlers[i]->next);
                   if (status != OK) {
                       return status;
                   }
  @@ -968,6 +977,7 @@
   
   void modperl_filter_runtime_add(pTHX_ request_rec *r, conn_rec *c,
                                   const char *name,
  +                                modperl_filter_mode_e mode,
                                   modperl_filter_add_t addfunc,
                                   SV *callback, const char *type)
   {
  @@ -990,7 +1000,7 @@
           }
   
           if (handler->attrs & MP_FILTER_HAS_INIT_HANDLER && handler->next)
{
  -            int status = modperl_run_filter_init(f, handler->next);
  +            int status = modperl_run_filter_init(f, mode, handler->next);
               if (status != OK) {
                   /* XXX */
               }
  
  
  
  1.24      +1 -0      modperl-2.0/src/modules/perl/modperl_filter.h
  
  Index: modperl_filter.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.h,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- modperl_filter.h	17 Apr 2003 08:04:47 -0000	1.23
  +++ modperl_filter.h	9 May 2003 03:33:01 -0000	1.24
  @@ -93,6 +93,7 @@
   
   void modperl_filter_runtime_add(pTHX_ request_rec *r, conn_rec *c,
                                   const char *name,
  +                                modperl_filter_mode_e mode,
                                   modperl_filter_add_t addfunc,
                                   SV *callback, const char *type);
   
  
  
  
  1.32      +4 -0      modperl-2.0/xs/Apache/Filter/Apache__Filter.h
  
  Index: Apache__Filter.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Apache__Filter.h	24 Apr 2003 05:00:58 -0000	1.31
  +++ Apache__Filter.h	9 May 2003 03:33:01 -0000	1.32
  @@ -187,6 +187,7 @@
       modperl_filter_runtime_add(aTHX_ r,
                                  r->connection,
                                  MP_FILTER_REQUEST_INPUT_NAME,
  +                               MP_INPUT_FILTER_MODE,
                                  ap_add_input_filter,
                                  callback,
                                  "InputFilter");
  @@ -200,6 +201,7 @@
       modperl_filter_runtime_add(aTHX_ r,
                                  r->connection,
                                  MP_FILTER_REQUEST_OUTPUT_NAME,
  +                               MP_OUTPUT_FILTER_MODE,
                                  ap_add_output_filter,
                                  callback,
                                  "OutputFilter");
  @@ -213,6 +215,7 @@
       modperl_filter_runtime_add(aTHX_ NULL,
                                  c,
                                  MP_FILTER_CONNECTION_INPUT_NAME,
  +                               MP_INPUT_FILTER_MODE,
                                  ap_add_input_filter,
                                  callback,
                                  "InputFilter");
  @@ -226,6 +229,7 @@
       modperl_filter_runtime_add(aTHX_ NULL,
                                  c,
                                  MP_FILTER_CONNECTION_OUTPUT_NAME,
  +                               MP_OUTPUT_FILTER_MODE,
                                  ap_add_output_filter,
                                  callback,
                                  "OutputFilter");
  
  
  
  1.113     +4 -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.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- FunctionTable.pm	16 Apr 2003 03:03:35 -0000	1.112
  +++ FunctionTable.pm	9 May 2003 03:33:02 -0000	1.113
  @@ -302,6 +302,10 @@
           'name' => 'name'
         },
         {
  +        'type' => 'modperl_filter_mode_e',
  +        'name' => 'mode'
  +      },
  +      {
           'type' => 'modperl_filter_add_t',
           'name' => 'addfunc'
         },
  
  
  
  1.184     +2 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.183
  retrieving revision 1.184
  diff -u -r1.183 -r1.184
  --- Changes	8 May 2003 00:31:27 -0000	1.183
  +++ Changes	9 May 2003 03:33:02 -0000	1.184
  @@ -12,6 +12,8 @@
   
   =item 1.99_10-dev
   
  +allow init filter handlers to call other methods than just $f->ctx [Stas]
  +
   Fix Apache::Reload to gracefully handle the case with empty Touchfiles
   [Dmitri Tikhonov <dmitri@netilla.com>]
   
  
  
  

Mime
View raw message