You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HipHop VM 3.18.5 (rel)
Compiler: tags/HHVM-3.18.5-0-g61f6a1f9a199c929980408aff866f36a7b4a1515
Repo schema: 514949365dd9d370d84ea5a6db4a3dd3b619e484
Standalone code, or other way to reproduce the problem
When the HHVM implementation of memcached is compressing a value, it correctly sets the MEMC_VAL_COMPRESSED flag, but fails to set the flag that specifies what type of compression is used (either MEMC_VAL_COMPRESSION_FASTLZ or MEMC_VAL_COMPRESSION_ZLIB). This becomes a problem when a non-HHVM implementation of memcached (like php-memcached) tries to read and decompress the value. It can see that the "compressed" flag is set, but doesn't know what compression type it is, and the read fails with a (misleading) error like:
Memcached::get(): could not decompress value: unrecognised encryption type
This HHVM implementation doesn't suffer from this problem because, if it can't determine the compression type, it falls back to decompressing with ZLIB.
I believe the fix is to change line 185 in ext_memcached.cpp from this:
HHVM Version
HipHop VM 3.18.5 (rel)
Compiler: tags/HHVM-3.18.5-0-g61f6a1f9a199c929980408aff866f36a7b4a1515
Repo schema: 514949365dd9d370d84ea5a6db4a3dd3b619e484
Standalone code, or other way to reproduce the problem
When the HHVM implementation of memcached is compressing a value, it correctly sets the
MEMC_VAL_COMPRESSED
flag, but fails to set the flag that specifies what type of compression is used (eitherMEMC_VAL_COMPRESSION_FASTLZ
orMEMC_VAL_COMPRESSION_ZLIB
). This becomes a problem when a non-HHVM implementation of memcached (like php-memcached) tries to read and decompress the value. It can see that the "compressed" flag is set, but doesn't know what compression type it is, and the read fails with a (misleading) error like:Memcached::get(): could not decompress value: unrecognised encryption type
This HHVM implementation doesn't suffer from this problem because, if it can't determine the compression type, it falls back to decompressing with ZLIB.
I believe the fix is to change line 185 in ext_memcached.cpp from this:
flags |= MEMC_VAL_COMPRESSED;
to this:
flags |= MEMC_VAL_COMPRESSED | MEMC_VAL_COMPRESSION_ZLIB;
The text was updated successfully, but these errors were encountered: