]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/HTTP.pm
http: use a larger buffer for ->getline responses
[public-inbox.git] / lib / PublicInbox / HTTP.pm
index 0f4b5047784a75b5b9bba21797fbd6cc584851d5..e65988bedf06fe2c5236e333bd7fc075021168b4 100644 (file)
@@ -91,6 +91,7 @@ sub event_step { # called by PublicInbox::DS
                }
                $self->do_read($rbuf, 8192, length($$rbuf)) or return;
        }
+       return quit($self, 400) if grep(/\s/, keys %env); # stop smugglers
        $$rbuf = substr($$rbuf, $r);
        my $len = input_prepare($self, \%env) //
                return write_err($self, undef); # EMFILE/ENFILE
@@ -234,7 +235,7 @@ sub getline_pull {
        # limit our own running time for fairness with other
        # clients and to avoid buffering too much:
        my $buf = eval {
-               local $/ = \8192;
+               local $/ = \65536;
                $forward->getline;
        } if $forward;