Aha.  I bet sfio is the problem, and I bet your solution is the correct
one.  I think that when you use sfio, mod_perl doesn't need to tie
STDOUT (it uses other methods for redirection), so Apache::Filter gets
confused.  Can anyone confirm these hypotheses?

If the following patch works for you, I'll incorporate it into the
official version.

-------------------------------------------------------------------------
--- Filter.pm   1999/09/12 03:25:45     1.3
+++ Filter.pm   1999/10/17 05:58:27
@@ -78,7 +78,13 @@
         # it was originally (usually the browser, unless this is a sub-request)
         warn "Tie()ing STDOUT to '$info->{'old_stdout'}' for finish" if $debug;
 
-        tie *STDOUT, $info->{'old_stdout'};  # Do we need to pass $r too?  Hope not.
+       if ($info->{'old_stdout'}) {
+         # Running under stdio, restore previous tie
+         tie *STDOUT, $info->{'old_stdout'};
+       } else {
+         # Running under sfio, just untie
+         untie *STDOUT;
+       }
         $r->send_http_header();
     } else {
         # There are more filters after this one.
-------------------------------------------------------------------------

[EMAIL PROTECTED] (Roland Alder) wrote:
>Hi Ken.
>
>Thank you again.
>
>> Perhaps it got untied in some previous run of the server.  As a
>> simple test, you might try restarting the server and testing
>> whether it also happens on the first request, possibly even
>> running in -X mode.
>
>I tried it. It is unset on the first request too. It is even unset in
>the first request when i start apache with -X.
>
>I tested this also with Embperl ([+ tied(*STDOUT) +]). It's unset to
>(no surprise).
>
>Can the sfio Library i compiled perl with be a problem? I've compiled
>perl with sfio for historical reasons (was required earlier for FastCGI
>and such). But i think this shouldn't be a problem.
>
>Because on my installation PerlHandlers seem to work (Embperl und
>such), even *STDOUT isn't tied, i came to the idea to untie *STDOUT in
>the last Filter (instead of tieing it to the stored value
>('old_stdout').
>
>I replaced "tie *STDOUT, $info->{'old_stdout'};" with "untie *STDOUT;"
>and tested it. It works. Is this a bad idea with more problems to rise,
>or a usable workaround?
>
>Thanks.
>
>
>--
>Roland Alder, Doerfli 3 / Schmidweg, CH-8634 Hombrechtikon
>e-mail: [EMAIL PROTECTED], WWW: http://galaxy.ch/roli/
>
>

  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  [EMAIL PROTECTED]                            The Math Forum

Reply via email to