You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ken Williams <ke...@forum.swarthmore.edu> on 2001/04/07 00:02:39 UTC

ANNOUNCE: Apache::Filter 1.017

The URL

    http://www.mathforum.com/~ken/modules/archive/Apache-Filter-1.017.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/K/KW/KWILLIAMS/Apache-Filter-1.017.tar.gz
  size: 24147 bytes
   md5: 304aabb626ae8694ca75e639b1981e7b


Changes from 1.016:

   Fixed a filehandle bug in which send_fd() would complain about a 'Bad
   filehandle'.  Occurred most often with Apache::Compress.
   
   Added a couple of tests to properly exercise the send_fd() method.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum

Re: ANNOUNCE: Apache::Filter 1.017

Posted by Ken Williams <ke...@forum.swarthmore.edu>.
jr.mayberry@e-vend.net (JR Mayberry) wrote:
>Is it required to, for instance, if you had a 4 chain handler as follows:
>
>ReadCache->Handler->WriteCache->Apache::Compress
>
>for the WriteCache handler to do:  $r->filter_input() and $r->print()
>while <$fh>  even if it doesnt need to?
>
>If I don't do that I seem to be losing all output, when I get to the
>Apache::Compress stage

I'm not actually sure which of two questions you might actually mean. 
If you mean 

 A) Must I call $r->filter_register in each handler?

the answer is yes.  Otherwise the bookkeeping gets off.  If you mean

 B) Must I actually print the input handle to the output filehandle if I 
    don't intend to change the data?

the answer is 'probably'.  

The input needs somehow to be turned to output.  Without doing this,
Apache::Filter can't tell the difference between a handler that doesn't
intend to change the output, and a handler that doesn't intend to send
any output at all.

This discussion suggests that perhaps there ought to be an easy/quick
way for a handler to declare that it doesn't intend to change the
output.  Perhaps a method could be added to Apache::Filter for this, if
it's a common need.

Right now, you could do the following in the no-op handlers:

  $r = $r->filter_register();
  my $fh = $r->filter_input;
  $r->send_fd($fh);

(though I'm not quite sure why these exist as content handlers if
they're no-ops.)


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum

Re: ANNOUNCE: Apache::Filter 1.017

Posted by JR Mayberry <jr...@e-vend.net>.
Is it required to, for instance, if you had a 4 chain handler as follows:

ReadCache->Handler->WriteCache->Apache::Compress

for the WriteCache handler to do:  $r->filter_input() and $r->print() while
<$fh>  even if it doesnt need to?

If I don't do that I seem to be losing all output, when I get to the
Apache::Compress stage



----- Original Message -----
From: "Ken Williams" <ke...@forum.swarthmore.edu>
To: "modperl" <mo...@apache.org>
Cc: "JR Mayberry" <jr...@e-vend.net>
Sent: Friday, April 06, 2001 6:02 PM
Subject: ANNOUNCE: Apache::Filter 1.017


> The URL
>
>
http://www.mathforum.com/~ken/modules/archive/Apache-Filter-1.017.tar.gz
>
> has entered CPAN as
>
>   file: $CPAN/authors/id/K/KW/KWILLIAMS/Apache-Filter-1.017.tar.gz
>   size: 24147 bytes
>    md5: 304aabb626ae8694ca75e639b1981e7b
>
>
> Changes from 1.016:
>
>    Fixed a filehandle bug in which send_fd() would complain about a 'Bad
>    filehandle'.  Occurred most often with Apache::Compress.
>
>    Added a couple of tests to properly exercise the send_fd() method.
>
>
>   -------------------                            -------------------
>   Ken Williams                             Last Bastion of Euclidity
>   ken@forum.swarthmore.edu                            The Math Forum