[livejournal] r17458: LJSUP-6901: catch connection abort sig.
Committer: vsukhanov
LJSUP-6901: catch connection abort sig.U trunk/cgi-bin/LJ/Request/Apache2.pm
Modified: trunk/cgi-bin/LJ/Request/Apache2.pm
===================================================================
--- trunk/cgi-bin/LJ/Request/Apache2.pm 2010-09-28 06:46:19 UTC (rev 17457)
+++ trunk/cgi-bin/LJ/Request/Apache2.pm 2010-09-28 07:18:33 UTC (rev 17458)
@@ -358,7 +358,14 @@
sub LJ::Request::print {
my $class = shift;
- $class->r()->print (@_);
+ my $res = eval { $class->r()->print (@_) };
+ if ($@){
+ return undef if $@ =~ m'Software caused connection abort'; ## that's not a real error.
+ ## upcoming client closed connection.
+ ## catch it and allow handler to complete work.
+ die $@; ## throw error
+ }
+ return $res;
}
sub LJ::Request::content_encoding {
