perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/xs/maps apache_functions.map
Date Tue, 24 Apr 2001 02:26:19 GMT
dougm       01/04/23 19:26:19

  Modified:    src/modules/perl modperl_filter.c modperl_filter.h
               t/filter/TestFilter input_body.pm input_msg.pm
               xs/Apache/Filter Apache__Filter.h
               xs/maps  apache_functions.map
  Log:
   adjust to ap_get_brigade() / input filter api changes
  
  Revision  Changes    Path
  1.17      +7 -4      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- modperl_filter.c	2001/04/20 00:43:47	1.16
  +++ modperl_filter.c	2001/04/24 02:26:17	1.17
  @@ -86,7 +86,8 @@
       return mg ? (modperl_filter_t *)mg->mg_ptr : NULL;
   }
   
  -int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode)
  +int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode,
  +                       apr_size_t *readbytes)
   {
       AV *args = Nullav;
       int status;
  @@ -109,6 +110,7 @@
   
       if (filter->mode == MP_INPUT_FILTER_MODE) {
           av_push(args, newSViv(mode));
  +        av_push(args, newSViv(*readbytes));
       }
   
       if ((status = modperl_callback(aTHX_ handler, p, s, args)) != OK) {
  @@ -321,7 +323,7 @@
       }
       else {
           filter = modperl_filter_new(f, bb, MP_OUTPUT_FILTER_MODE);
  -        status = modperl_run_filter(filter, 0);
  +        status = modperl_run_filter(filter, 0, 0);
       }
   
       switch (status) {
  @@ -336,7 +338,8 @@
   
   apr_status_t modperl_input_filter_handler(ap_filter_t *f,
                                             apr_bucket_brigade *bb,
  -                                          ap_input_mode_t mode)
  +                                          ap_input_mode_t mode,
  +                                          apr_size_t *readbytes)
   {
       modperl_filter_t *filter;
       int status;
  @@ -348,7 +351,7 @@
       }
       else {
           filter = modperl_filter_new(f, bb, MP_INPUT_FILTER_MODE);
  -        status = modperl_run_filter(filter, mode);
  +        status = modperl_run_filter(filter, mode, readbytes);
       }
   
       switch (status) {
  
  
  
  1.6       +4 -2      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- modperl_filter.h	2001/04/20 00:43:47	1.5
  +++ modperl_filter.h	2001/04/24 02:26:17	1.6
  @@ -25,7 +25,8 @@
   
   modperl_filter_t *modperl_filter_mg_get(pTHX_ SV *obj);
   
  -int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode);
  +int modperl_run_filter(modperl_filter_t *filter, ap_input_mode_t mode,
  +                       apr_size_t *readbytes);
   
   /* output filters */
   apr_status_t modperl_output_filter_handler(ap_filter_t *f,
  @@ -49,7 +50,8 @@
   /* input filters */
   apr_status_t modperl_input_filter_handler(ap_filter_t *f,
                                             apr_bucket_brigade *bb,
  -                                          ap_input_mode_t mode);
  +                                          ap_input_mode_t mode,
  +                                          apr_size_t *readbytes);
   
   int modperl_input_filter_register_connection(conn_rec *c);
   
  
  
  
  1.4       +2 -2      modperl-2.0/t/filter/TestFilter/input_body.pm
  
  Index: input_body.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_body.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- input_body.pm	2001/04/20 01:21:28	1.3
  +++ input_body.pm	2001/04/24 02:26:17	1.4
  @@ -13,10 +13,10 @@
   use APR::Bucket ();
   
   sub handler : InputFilterBody {
  -    my($filter, $bb, $mode) = @_;
  +    my($filter, $bb, $mode, $readbytes) = @_;
   
       if ($bb->empty) {
  -        my $rv = $filter->next->get_brigade($bb, $mode);
  +        my $rv = $filter->next->get_brigade($bb, $mode, $readbytes);
   
           if ($rv != APR::SUCCESS) {
               return $rv;
  
  
  
  1.4       +2 -2      modperl-2.0/t/filter/TestFilter/input_msg.pm
  
  Index: input_msg.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/input_msg.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- input_msg.pm	2001/04/20 01:21:28	1.3
  +++ input_msg.pm	2001/04/24 02:26:17	1.4
  @@ -14,10 +14,10 @@
   my $to_url = '/TestFilter::input_msg::response';
   
   sub handler : InputFilterMessage {
  -    my($filter, $bb, $mode) = @_;
  +    my($filter, $bb, $mode, $readbytes) = @_;
   
       if ($bb->empty) {
  -        my $rv = $filter->next->get_brigade($bb, $mode);
  +        my $rv = $filter->next->get_brigade($bb, $mode, $readbytes);
   
           if ($rv != APR::SUCCESS) {
               return $rv;
  
  
  
  1.9       +15 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Apache__Filter.h	2001/04/20 15:40:06	1.8
  +++ Apache__Filter.h	2001/04/24 02:26:18	1.9
  @@ -58,6 +58,21 @@
       return len;
   }
   
  +static apr_status_t mpxs_ap_get_brigade(pTHX_ ap_filter_t *filter,
  +                                        apr_bucket_brigade *brigade,
  +                                        ap_input_mode_t mode,
  +                                        SV *svreadbytes)
  +{
  +    apr_size_t readbytes = svreadbytes ? SvIV(svreadbytes) : 0;
  +    apr_status_t status = ap_get_brigade(filter, brigade, mode, &readbytes);
  +
  +    if (svreadbytes) {
  +        sv_setiv(svreadbytes, readbytes);
  +    }
  +
  +    return status;
  +}
  +
   static MP_INLINE U32 *modperl_filter_attributes(SV *package, SV *cvrv)
   {
       return (U32 *)&MP_CODE_ATTRS(SvRV(cvrv));
  
  
  
  1.13      +2 -1      modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apache_functions.map	2001/04/19 17:41:38	1.12
  +++ apache_functions.map	2001/04/24 02:26:19	1.13
  @@ -186,7 +186,8 @@
   PACKAGE=guess
   ~ap_add_output_filter
    ap_add_input_filter
  - ap_get_brigade | | filter, bucket, mode=AP_MODE_NONBLOCKING
  + ap_get_brigade | mpxs_ | \
  +               filter, bucket, mode=AP_MODE_NONBLOCKING, SV *:readbytes=Nullsv
    ap_pass_brigade
    ap_register_input_filter
    ap_register_output_filter
  
  
  

Mime
View raw message