Skip to content

Commit 979a363

Browse files
committed
Item14221: Revert Engine changes made by Item14205
Reverts two commits: - 74d590a - d079f79
1 parent efab1aa commit 979a363

File tree

4 files changed

+5
-36
lines changed

4 files changed

+5
-36
lines changed

FastCGIEngineContrib/lib/Foswiki/Engine/FastCGI.pm

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,7 @@ sub run {
6565
or die "Failed to create FastCGI socket: $!";
6666
}
6767
$args ||= {};
68-
69-
# Prepare output handles for FastCGI.
70-
$this->{$_} = IO::Handle->new foreach qw(fhIN fhOUT fhERR);
71-
# This is a little trick to make all `print STDERR' clauses send their
72-
# output to the log file. May not work for spawned processes.
73-
STDERR->fdopen($this->{fhERR}->fileno, "w");
74-
my $r = FCGI::Request( $this->{fhIN}, $this->{fhOUT}, $this->{fhERR}, \%ENV, $sock,
68+
my $r = FCGI::Request( \*STDIN, \*STDOUT, \*STDERR, \%ENV, $sock,
7569
&FCGI::FAIL_ACCEPT_ON_INTR );
7670
my $manager;
7771

@@ -193,8 +187,7 @@ sub preparePath {
193187
}
194188

195189
sub write {
196-
my $this = shift;
197-
syswrite $this->{fhOUT}, $_[0];
190+
syswrite STDOUT, $_[1];
198191
}
199192

200193
sub closeSocket {

core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ NOCERT
184184

185185
if ( $Foswiki::cfg{SMTP}{MAILHOST} ) {
186186

187-
if ( 1
188-
|| $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} !~ m/FastCGI$/ )
189-
{
187+
if ( $Foswiki::cfg{Engine} && $Foswiki::cfg{Engine} !~ m/FastCGI$/ ) {
190188
( $ok, $out, $err ) = _muteExec( \&_autoconfigSMTP, $reporter );
191189
}
192190
else {

core/lib/Foswiki/Engine.pm

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,12 @@ BEGIN {
3434
3535
Constructs an engine object.
3636
37-
The default object has three initialized keys on it: =fhIN=, =fhOUT=, =fhERR=.
38-
Those are filehandles used to communicate with HTTP server/environment and by
39-
default they're set to =STDIN=, =STDOUT=, and =STDERR= correspondingly. It is
40-
recommended to use =$engine->{fhERR}= instead of STDERR in order to get error
41-
messages always logged correctly:
42-
43-
<verbatim>
44-
print $Foswiki::engine->{fhERR} "This is the error we wanna see in the log.\n";
45-
46-
$SIG{__DIE__} = sub {
47-
print $Foswiki::engine->{fhERR} @_;
48-
exit 1;
49-
};
50-
</verbatim>
51-
5237
=cut
5338

5439
sub new {
5540
my $proto = shift;
5641
my $class = ref($proto) || $proto;
57-
my $this = {
58-
59-
# Standard file handles to support engines/environments where
60-
# communication is based on custom sockets.
61-
fhIN => \*STDIN,
62-
fhOUT => \*STDOUT,
63-
fhERR => \*STDERR,
64-
};
42+
my $this = {};
6543
return bless $this, $class;
6644
}
6745

core/lib/Foswiki/Engine/CGI.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ sub prepareBody {
220220
# as breaking uploads (though cdot believes this is because of the
221221
# deprecated dual nature of param delivering lightweight file handles,
222222
# and it would probably work in Foswiki. Just not tried it)
223-
my $cgi = new CGI( $this->{fhIN} );
223+
my $cgi = new CGI();
224224
my $err = $cgi->cgi_error;
225225
throw Foswiki::EngineException( $1, $2 )
226226
if defined $err && $err =~ m/\s*(\d{3})\s*(.*)/;

0 commit comments

Comments
 (0)