From b99e2465205a8f27801066b1e914bd4091406fa2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 24 Jan 2020 09:43:50 +0000 Subject: wwwstatic: offload error handling to PSGI server The PSGI server needs to account for ->getline failing due to disk failures or truncated files, anyways. So just die() ourselves and let the PSGI server log and drop the client. --- lib/PublicInbox/WwwStatic.pm | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/PublicInbox/WwwStatic.pm b/lib/PublicInbox/WwwStatic.pm index 917049bb..e1f536f3 100644 --- a/lib/PublicInbox/WwwStatic.pm +++ b/lib/PublicInbox/WwwStatic.pm @@ -169,16 +169,7 @@ sub getline { return $buf; } my $m = defined $r ? "EOF with $len bytes left" : "read error: $!"; - my $env = $self->{env}; - $env->{'psgi.errors'}->print("$self->{path} $m\n"); - - # drop the client on error - if (my $io = $env->{'psgix.io'}) { - $io->close; # this is likely PublicInbox::DS::close - } else { # for some PSGI servers w/o psgix.io - die "dropping client socket\n"; - } - undef; + die "$self->{path} $m, dropping client socket\n"; } sub close {} # noop, called by PSGI server, just let everything go out-of-scope -- cgit v1.2.3-24-ge0c7