Subject: | compression doesn't work |
The logic for calculating the "compression savings" looks wrong. With this patch it's owrking
for us again.
--- a/lib/perl5/Cache/Memcached/libmemcached.pm
+++ b/lib/perl5/Cache/Memcached/libmemcached.pm
@@ -175,7 +175,7 @@ sub _mk_callbacks
my $length = bytes::length($_);
if ($length > $self->{compress_threshold}) {
my $tmp = Compress::Zlib::memGzip($_);
- if (1 - bytes::length($tmp) / $length < $self->{compress_savingsS}) {
+ if (bytes::length($tmp) / $length < 1 - $self->{compress_savingsS}) {
$_ = $tmp;
$_[1] |= F_COMPRESS;
}