about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-04-02 00:45:48 +0000
committerEric Wong <e@80x24.org>2019-04-02 08:05:09 +0000
commitc1b26477f9c60338ee1ebafd7d37628692ff7332 (patch)
treea14becdb6ee89b250240e759f31c2c70a4373fa2
parent089cca37fa03641138d229dc5dbe76b382fc200f (diff)
downloadpublic-inbox-c1b26477f9c60338ee1ebafd7d37628692ff7332.tar.gz
Not entirely sure what is causing this, but it appears to
be causing infinite loops when attempting to display certain
blobs.

Fortunately, the fair scheduling of public-inbox-httpd prevented
this from becoming a real problem aside from increasing CPU
usage.
-rw-r--r--lib/PublicInbox/ViewVCS.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/PublicInbox/ViewVCS.pm b/lib/PublicInbox/ViewVCS.pm
index f5374517..ae721034 100644
--- a/lib/PublicInbox/ViewVCS.pm
+++ b/lib/PublicInbox/ViewVCS.pm
@@ -62,6 +62,10 @@ sub stream_large_blob ($$$$) {
                                 my $ct = 'text/plain; charset=UTF-8';
                                 return [200, ['Content-Type', $ct, @cl] ];
                         }
+                        if ($r == 0) {
+                                warn "premature EOF on $oid $$logref\n";
+                                return html_page($ctx, 500, $logref);
+                        }
                         undef; # bref keeps growing
                 }
         });