You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by barries <ba...@slaysys.com> on 2001/05/29 21:16:32 UTC

The case for sending EOS from ResponseHandler

I tripped over the fact that the PerlResponseHandler does not send EOS
(which is optional, after all).  Here are a couple of reasons mod_perl
should go ahead and send the EOS right after the PerlRespnseHandler
exits:

- Efficiency: one less brigade & associated calls, since it can be added
  to the tail of the last bucket brigade sent.  This saves us from
  having to call filter handlers twice[1].
- Testing of EOS handling in mod_perl test suite.  For instance, I can't
  test the Apache::Filter->eof() correctly right now, since it never sees the
  EOS.

The easiest way I can think of to do this is to add "send_eos" flags as
new parameters to modperl_wbucket_pass() and modperl_wbucket_flush().

It would also be nice to be able to send the EOS from within the
PerlResponseHandler subroutine, so that output filters could be flushed
before doing any real cleanup.  The new Apache::Filter->close() does
that for filter handlers, for instance, although it may allow multiple
EOSed to be sent downstream as-is (I need to look at it and see if
close()ing before the real EOS is receoived sends two downstream).

- Barrie

[1] I know they aren't called twice, since EOS-only bucket brigades
don't cause a filter handler to be called.  But I think they need to be
called so that filter handlers can flush internal state.

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


Re: The case for sending EOS from ResponseHandler

Posted by do...@apache.org.
On Tue, 29 May 2001, barries wrote:

> I tripped over the fact that the PerlResponseHandler does not send EOS
> (which is optional, after all).  Here are a couple of reasons mod_perl
> should go ahead and send the EOS right after the PerlRespnseHandler
> exits:
> 
> - Efficiency: one less brigade & associated calls, since it can be added
>   to the tail of the last bucket brigade sent.  This saves us from
>   having to call filter handlers twice[1].
> - Testing of EOS handling in mod_perl test suite.  For instance, I can't
>   test the Apache::Filter->eof() correctly right now, since it never sees the
>   EOS.
> 
> The easiest way I can think of to do this is to add "send_eos" flags as
> new parameters to modperl_wbucket_pass() and modperl_wbucket_flush().

sounds good.
 
> It would also be nice to be able to send the EOS from within the
> PerlResponseHandler subroutine, so that output filters could be flushed
> before doing any real cleanup.  The new Apache::Filter->close() does
> that for filter handlers, for instance, although it may allow multiple
> EOSed to be sent downstream as-is (I need to look at it and see if
> close()ing before the real EOS is receoived sends two downstream).

have close() flush the buffer / send eos would be useful.  only thing that
would break is the ability for mod_perl to buffer up all the output data,
and wait until the interpreter is released to flush downstream.  of
course, not everybody is concerned with that, and calling close() would be
optional.



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