X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwStatic.pm;h=e1f536f3f21c1d7ce63ea74f140d2646fb1284b1;hb=b99e2465205a8f27801066b1e914bd4091406fa2;hp=bc42236e57b6e6442db9c7351e76587f68d3d871;hpb=078f637c80cc33c7d29973b95fdc16205ad7bb32;p=public-inbox.git diff --git a/lib/PublicInbox/WwwStatic.pm b/lib/PublicInbox/WwwStatic.pm index bc42236e..e1f536f3 100644 --- a/lib/PublicInbox/WwwStatic.pm +++ b/lib/PublicInbox/WwwStatic.pm @@ -12,7 +12,7 @@ use strict; use parent qw(Exporter); use bytes (); use Fcntl qw(SEEK_SET O_RDONLY O_NONBLOCK); -use POSIX qw(strftime lround); +use POSIX qw(strftime); use HTTP::Date qw(time2str); use HTTP::Status qw(status_message); use Errno qw(EACCES ENOTDIR ENOENT); @@ -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 @@ -238,7 +229,7 @@ sub human_size ($) { last; } } - lround($size).$suffix; + sprintf('%lu', $size).$suffix; } # by default, this returns "index.html" if it exists for a given directory