Bug 18348 - Errorlogging / STDERR from nph-cgi-scripts broken
Summary: Errorlogging / STDERR from nph-cgi-scripts broken
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_cgi (show other bugs)
Version: 2.0.43
Hardware: All FreeBSD
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-25 22:46 UTC by Sander Holthaus
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sander Holthaus 2003-03-25 22:46:16 UTC
Non parsed header scripts are not able to log any errors or warnings to the 
errorlog, while (almost) the same non-nph script will generate errors and 
warnings for the same script.

example:


#!/usr/bin/perl -w
use strict;
$|=1;
warn "me";
print "$ENV{SERVER_PROTOCOL} 204 No Content\n";
print "Server: $ENV{SERVER_SOFTWARE}\n";
print "Date: $date\n";
exit;

will not log anything, while it should due to the warn in line 4.
Comment 1 Jeff Trawick 2003-07-10 21:10:11 UTC
Allegedly this scenario is handled by

http://www.apache.org/~trawick/mod_cgi.c

which handles the three I/O channels with the script in a more sane way, at
least as unix-heads would see it.
Comment 2 Joe Orton 2004-05-05 19:46:25 UTC
Fixed on HEAD by extracting the relevant change from Jeff's mod_cgi.c (thanks
Jeff!).

http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/generators/mod_cgi.c?r1=1.162&r2=1.163

Backport of recent mod_cgi changes to 2.0 is here:

http://www.apache.org/~jorton/mod_cgi-2.0.diff