about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-24 09:43:50 +0000
committerEric Wong <e@yhbt.net>2020-01-25 19:20:54 +0000
commitb99e2465205a8f27801066b1e914bd4091406fa2 (patch)
tree2e9ca66e1c14a2e278c3f9d1606ab6b32a00983e /lib
parent13aee729fa6d49ffb8583af8f780e836f8f7d503 (diff)
downloadpublic-inbox-b99e2465205a8f27801066b1e914bd4091406fa2.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/WwwStatic.pm11
1 files changed, 1 insertions, 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