diff options
author | ivan <ivan> | 2002-02-20 10:39:53 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-02-20 10:39:53 +0000 |
commit | b4d4e05b95414fc334bf80474a0c10f639ac4ba1 (patch) | |
tree | 59978f9ab2700ad15354e6c6d649d748ecbf71be | |
parent | 436df4de2b0cd4442eaf37f880f0ae017debeaf5 (diff) |
fixes eidiot under Mason, closes: Bug#344
-rw-r--r-- | FS/FS/CGI.pm | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index ee59b259f..190c0aa37 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -131,6 +131,8 @@ Sends an HTML error message, then exits. sub eidiot { warn "eidiot depriciated"; + $HTML::Mason::Commands::r->send_http_header + if defined $HTML::Mason::Commands::r; idiot(@_); &myexit(); } @@ -145,11 +147,22 @@ If running under mod_perl, calles Apache::exit, otherwise, calls exit. sub myexit { if (exists $ENV{MOD_PERL}) { - $main::Response->End() - if defined $main::Response - && $main::Response->isa('Apache::ASP::Response'); - require Apache; - Apache::exit(); + + if ( defined $main::Response + && $main::Response->isa('Apache::ASP::Response') ) { #Apache::ASP + $main::Response->End(); + require Apache; + Apache::exit(); + } elsif ( defined $HTML::Mason::Commands::m ) { #Mason + #$HTML::Mason::Commands::m->flush_buffer(); + $HTML::Mason::Commands::m->abort(); + die "shouldn't fall through to here (mason \$m->abort didn't)"; + } else { + #??? well, it is $ENV{MOD_PERL} + warn "running under unknown mod_perl environment; trying Apache::exit()"; + require Apache; + Apache::exit(); + } } else { exit; } |