about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-12-25 09:40:25 +0000
committerEric Wong <e@80x24.org>2016-12-25 09:40:38 +0000
commit9511829a9c836a2887d9a569275cc599a463d922 (patch)
tree18f482a9ca9ccb70c998abffda39f683a1e06780 /lib
parentd9e9c8ed84a15c7fdf8fa57e82fcec9de7ecba87 (diff)
downloadpublic-inbox-9511829a9c836a2887d9a569275cc599a463d922.tar.gz
Oops, this would be disatrous if we started handling
bigger request bodies or slow clients.

Fixes: c008654229a9 ("avoid IO::File for anonymous temporary files")
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/HTTP.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index cac14be3..c4b74b45 100644
--- a/lib/PublicInbox/HTTP.pm
+++ b/lib/PublicInbox/HTTP.pm
@@ -328,7 +328,7 @@ sub more ($$) {
 
 sub input_prepare {
         my ($self, $env) = @_;
-        my $input = $null_io;
+        my $input;
         my $len = $env->{CONTENT_LENGTH};
         if ($len) {
                 if ($len > $MAX_REQUEST_BUFFER) {
@@ -339,6 +339,8 @@ sub input_prepare {
         } elsif (env_chunked($env)) {
                 $len = CHUNK_START;
                 open($input, '+>', undef);
+        } else {
+                $input = $null_io;
         }
 
         # TODO: expire idle clients on ENFILE / EMFILE