perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: modperl-2.0 Changes
Date Sun, 12 Jan 2003 02:26:18 GMT
stas@apache.org wrote:
> stas        2003/01/11 18:21:37
> 
>   Modified:    src/modules/perl modperl_filter.c
>                .        Changes
>   Log:
>   Request input and output filters are now getting the EOS bucket, which
>   wasn't passed through before. Now the context can be flushed on
>   EOS.

Doug, since the logic for skipping EOS wasn't explained I've removed it. 
The reason for always passing EOS to the filter is that so it knows when 
the context can be flushed. Before that patch it was impossible.

Also notice that the EOS bucket can be a part of a bb with other buckets 
as well as to be the only one. So there shouldn't be any special 
handling for this.

This change will possibly break some of the code where people have 
erroneously relied on the filter to be called once during request time. 
I'll shortly update the tests and the online docs to show the proper way 
to handle things.

>   Revision  Changes    Path
>   1.42      +4 -21     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.41
>   retrieving revision 1.42
>   diff -u -r1.41 -r1.42
>   --- modperl_filter.c	12 Jan 2003 02:15:58 -0000	1.41
>   +++ modperl_filter.c	12 Jan 2003 02:21:37 -0000	1.42
>   @@ -383,24 +383,14 @@
>        return modperl_wbucket_write(&filter->wbucket, buf, len);
>    }
>    
>   -#define APR_BRIGADE_IS_EOS(bb) \
>   -APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(bb))
>   -
>    apr_status_t modperl_output_filter_handler(ap_filter_t *f,
>                                               apr_bucket_brigade *bb)
>    {
>        modperl_filter_t *filter;
>        int status;
>    
>   -    if (APR_BRIGADE_IS_EOS(bb)) {
>   -        /* XXX: see about preventing this in the first place */
>   -        MP_TRACE_f(MP_FUNC, "first bucket is EOS, skipping callback\n");
>   -        return ap_pass_brigade(f->next, bb);
>   -    }
>   -    else {
>   -        filter = modperl_filter_new(f, bb, MP_OUTPUT_FILTER_MODE);
>   -        status = modperl_run_filter(filter, 0, 0, 0);
>   -    }
>   +    filter = modperl_filter_new(f, bb, MP_OUTPUT_FILTER_MODE);
>   +    status = modperl_run_filter(filter, 0, 0, 0);
>    
>        switch (status) {
>          case OK:
>   @@ -421,15 +411,8 @@
>        modperl_filter_t *filter;
>        int status;
>    
>   -    if (APR_BRIGADE_IS_EOS(bb)) {
>   -        /* XXX: see about preventing this in the first place */
>   -        MP_TRACE_f(MP_FUNC, "first bucket is EOS, skipping callback\n");
>   -        return APR_SUCCESS;
>   -    }
>   -    else {
>   -        filter = modperl_filter_new(f, bb, MP_INPUT_FILTER_MODE);
>   -        status = modperl_run_filter(filter, mode, block, readbytes);
>   -    }
>   +    filter = modperl_filter_new(f, bb, MP_INPUT_FILTER_MODE);
>   +    status = modperl_run_filter(filter, mode, block, readbytes);
>    
>        switch (status) {
>          case OK:
>   
>   
>   
>   1.98      +4 -0      modperl-2.0/Changes
>   
>   Index: Changes
>   ===================================================================
>   RCS file: /home/cvs/modperl-2.0/Changes,v
>   retrieving revision 1.97
>   retrieving revision 1.98
>   diff -u -r1.97 -r1.98
>   --- Changes	11 Jan 2003 04:17:58 -0000	1.97
>   +++ Changes	12 Jan 2003 02:21:37 -0000	1.98
>   @@ -10,6 +10,10 @@
>    
>    =item 1.99_09-dev
>    
>   +Request input and output filters are now getting the EOS bucket, which
>   +wasn't passed through before. Now the context can be flushed on
>   +EOS. [Stas]
>   +
>    =item 1.99_08 - January 10, 2003
>    
>    Correct ModPerl::RegistryCooker to reset %INC, after compile for .pl
>   
>   
>   


-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message