Skip to content

zstd support #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Error if we see zstd-compressed values but don't have zstd support
  • Loading branch information
rlerdorf committed Apr 26, 2023
commit 72da554abdd15456c780af8cf925d101e0555afe
7 changes: 7 additions & 0 deletions php_memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -3651,6 +3651,13 @@ zend_string *s_decompress_value (const char *payload, size_t payload_len, uint32
is_zstd = MEMC_VAL_HAS_FLAG(flags, MEMC_VAL_COMPRESSION_ZSTD);
is_zlib = MEMC_VAL_HAS_FLAG(flags, MEMC_VAL_COMPRESSION_ZLIB);

#ifndef HAVE_ZSTD_H
if (is_zstd) {
php_error_docref(NULL, E_WARNING, "could not decompress value: value was compressed with zstd but zstd support has not been compiled in");
return NULL;
}
#endif

if (!is_fastlz && !is_zlib && !is_zstd) {
php_error_docref(NULL, E_WARNING, "could not decompress value: unrecognised compression type");
return NULL;
Expand Down