|


| NAVIGATION |
|
Home |
|
Store |
|
|
| INSIDE MAC |
|
Television Shows |
|
Broadcast Shows |
|
Daily News Shows |
|
Special Shows |
|
|
| EVENTS |
|
|
|
|
|
|
|
|
| DAILY TIPS |
|
Design |
|
Mac OS X |
|
Mac OS X UNIX |
|
|
| COMMUNITY |
|
Forums |
|
Surveys |
|
|
| NEWS |
|
Current |
|
Press |
|
Archive |
|
|
| FEATURES |
|
Editorial |
|
Dr. Mac |
|
Reviews |
|
Reader Reports |
|
|
| RESOURCES |
|
FAQ |
|
Documentation |
|
Learning Center |
|
MAN pages |
|
Glossary |
|
Tutorials |
|
Tips |
|
Links |
|
|
|

|
|
|
Apache::SIG - Override apache signal handlers with Perl's
SYNOPSIS
PerlFixupHandler Apache::SIG
DESCRIPTION
When a client drops a connection and apache is in the mid-
dle of a write, a timeout will occur and httpd sends a
SIGPIPE. When apache's SIGPIPE handler is used, Perl may
be left in the middle of it's eval context, causing
bizarre errors during subsequent requests are handled by
that child. When Apache::SIG is used, it installs a dif-
ferent SIGPIPE handler which rewinds the context to make
sure Perl is back to normal state, preventing these
bizarre errors.
If you would like to log when a request was cancelled by a
SIGPIPE in your Apache access_log, you can declare
Apache::SIG as a handler (any Perl*Handler will do, as
long as it is run before PerlHandler, e.g. PerlFixupHan-
dler), and you must also define a custom LogFormat in your
httpd.conf, like so:
PerlFixupHandler Apache::SIG LogFormat "%h %l %u %t \"%r\"
%s %b %{SIGPIPE}e"
If the server has noticed that the request was cancelled
via a SIGPIPE, then the log line will end with `1', other-
wise it will just be a dash.
CAVEATS
The signal handler in this package uses the subprocess_env
table of the main request object to supply the 'SIGPIPE'
"environment variable" to the log handler. If you already
use the key 'SIGPIPE' in your subprocess_env table, then
you can redefine the key like this:
$Apache::SIG::PipeKey = 'my_SIGPIPE';
and log it like this:
LogFormat "%h %l %u %t \"%r\" %s %b %{my_SIGPIPE}e"
AUTHORS
Doug MacEachern and Doug Bagley
SEE ALSO
perlvar(1)
|





|
 |
|
 |
Copyright © 2000-2008 Inside Mac Media, Inc. All rights reserved. |
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users. |
| Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc. |
|