@@ -, +, @@ --- spamd/spamd.raw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/spamd/spamd.raw +++ a/spamd/spamd.raw @@ -1826,12 +1826,12 @@ sub zlib_inflate_read { # TODO: inflate in smaller buffers instead of at EOF while (1) { - my $numbytes = $client->read($buf, (1024 * 64) + $red, $red); + my $numbytes = $client->read($buf, $expected_length - $red, $red); if (!defined $numbytes) { die "read of zlib data failed: $!"; return -1; } - last if $numbytes == 0; + last if $numbytes == $expected_length; $red += $numbytes; } --