X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FNNTPdeflate.pm;h=dec88aba3a5f22d90af5c3fd8afb6a9504362f4c;hb=3c947561fa0678803158f2174ff87992addb3c7e;hp=eb400c9c22057da11b5bd3d3d396ab79213c7108;hpb=8fd41797b24736dfdccfacc5acc473234a29758a;p=public-inbox.git diff --git a/lib/PublicInbox/NNTPdeflate.pm b/lib/PublicInbox/NNTPdeflate.pm index eb400c9c..dec88aba 100644 --- a/lib/PublicInbox/NNTPdeflate.pm +++ b/lib/PublicInbox/NNTPdeflate.pm @@ -71,6 +71,16 @@ sub do_read ($$$$) { $doff = length($dbuf); my $r = PublicInbox::DS::do_read($self, \$dbuf, $len, $doff) or return; + # Workaround inflate bug appending to OOK scalars: + # + # We only have $off if the client is pipelining, and pipelining + # is where our substr() OOK optimization in event_step makes sense. + if ($off) { + my $copy = $$rbuf; + undef $$rbuf; + $$rbuf = $copy; + } + # assert(length($$rbuf) == $off) as far as NNTP.pm is concerned # -ConsumeInput is true, so $dbuf is automatically emptied my $err = $zin->inflate($dbuf, $rbuf);