X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FIMAPdeflate.pm;fp=lib%2FPublicInbox%2FIMAPdeflate.pm;h=42daa6cffaaa37f75b581e4665ebfece65cf8a77;hp=67c9a9738d54836fe12edf7a5911983945c41ba4;hb=c4dd2b484bbb20f2be0d7bc4a0ae0e91df635b4a;hpb=afa44e1ddf1b9402caba5c7dc3c8e0f86194df86 diff --git a/lib/PublicInbox/IMAPdeflate.pm b/lib/PublicInbox/IMAPdeflate.pm index 67c9a973..42daa6cf 100644 --- a/lib/PublicInbox/IMAPdeflate.pm +++ b/lib/PublicInbox/IMAPdeflate.pm @@ -59,6 +59,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);