[ic] Link.pm updates, please commit
Grant
emailgrant at gmail.com
Mon Nov 12 10:30:15 EST 2007
I've made three changes to the current Interchange::Link which are
working out great. The first one allows a proper 404 to be returned:
close (SOCK) or die "close: $!\n";
- return Apache2::Const::OK;
+ return Apache2::Const::NOT_FOUND
The second removes all blank lines from IC's HTML/CSS output:
while( <SOCK> ) {
- push @out, $_;
+ push @out, $_ if /\S/;
I realize that not everyone will want the blank lines removed from
their HTML/CSS output, so maybe someone can slap together a quick
variable in the module that sets it up as an option?
The third and most important prevents the frequent segmentation faults
and intermittent "Connection reset by peer" errors I had previously
been plagued with:
- $SIG{PIPE} = sub { die_page($r); };
+ $SIG{PIPE} = 'IGNORE';
The entire die_page sub can also be removed. For a little more info
on this, just removing the $r->content_type and $r->print sections
from the die_page sub will prevent the seg faults, but using 'IGNORE'
as above also prevents the intermittent "Connection reset by peer"
errors.
- Grant
More information about the interchange-users
mailing list