Tatsuhiko Miyagawa wrote:
> At Thu, 04 Jul 2002 20:07:12 +0900,
> Tatsuhiko Miyagawa wrote:
>  
> 
>>I mean I don't use perl-script or modperl for content generation. just
>>serves  plain .html file with default-handler.
> 
> 
> OK. I tried
> 
> <Location /hello>
> SetHandler modperl
> PerlResponseHandler Slasher::Hello
> PerlOutputFilterHandler Slasher::HTMLTemplate
> </Location>
> 
> and then it worked!
> 
> okay, current TestFilter::lc test is applied to static file, thus
> here's a patch to reproduce the failure:
> 
> (does it never get flushed? if I put die() after last print(), the
> message gets out before "OK" annoying error messages)

Good observation. I can reproduce this problem with non-mod_perl 
handler. Actually I've continued building on top of the reverse test. 
For some reason I like it :)

When a file is sent the EOS bucket arrives as well. And after the EOS 
bucket went through the filter shouldn't send anything at all. If the 
filter wants to add something it must remove the EOS bucket, send 
whatever it needs to send and then re-insert the EOS bucket. And in the 
stream mode this should be done transparently to the filter.

As a temp workaround to get you going you can use this patch, but I 
think it's a bad hack. I'll try to come up with something better.

Index: src/modules/perl/modperl_filter.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
retrieving revision 1.36
diff -u -r1.36 modperl_filter.c
--- src/modules/perl/modperl_filter.c   29 Jun 2002 20:38:33 -0000      1.36
+++ src/modules/perl/modperl_filter.c   5 Jul 2002 13:11:35 -0000
@@ -156,6 +156,14 @@
      MP_TRACE_f(MP_FUNC, "%s returned %d\n", handler->name, status);

      if (filter->mode == MP_OUTPUT_FILTER_MODE) {
+        /* XXX: if the filter wrote something after the original eos
+         *  bucket went through flush the remaining data if any left
+         *  (currently in the stream mode the filter cannot remove an
+         *  eos bucket, or add one)
+         */
+        if (filter->wbucket.outcnt) {
+            filter->flush = 1;
+        }
          modperl_output_filter_flush(filter);
      }


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to