Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.m423
-rw-r--r--library.c9
2 files changed, 15 insertions, 17 deletions
diff --git a/config.m4 b/config.m4
index c1f793c8..d84ff46c 100644
--- a/config.m4
+++ b/config.m4
@@ -133,15 +133,20 @@ dnl Check for msgpack
AC_MSG_CHECKING([for redis msgpack support])
if test "$PHP_REDIS_MSGPACK" != "no"; then
- AC_MSG_RESULT([enabled])
- AC_DEFINE(HAVE_REDIS_MSGPACK,1,[Whether redis msgpack serializer is enabled])
- MSGPACK_INCLUDES="-I$msgpack_inc_path"
- MSGPACK_EXT_DIR="$msgpack_inc_path/ext"
- ifdef([PHP_ADD_EXTENSION_DEP],
- [
- PHP_ADD_EXTENSION_DEP(redis, msgpack)
- ])
- PHP_ADD_INCLUDE($MSGPACK_EXT_DIR)
+ msgpack_version=`grep -o 'PHP_MSGPACK_VERSION "[0-9\.]\+"' $msgpack_inc_path/ext/msgpack/php_msgpack.h | awk '{print $2}' | tr -d '"'`
+ if expr $msgpack_version "<" "2.0.3" > /dev/null; then
+ AC_MSG_ERROR([msgpack 2.0.3 or greater required])
+ else
+ AC_MSG_RESULT([enabled])
+ AC_DEFINE(HAVE_REDIS_MSGPACK,1,[Whether redis msgpack serializer is enabled])
+ MSGPACK_INCLUDES="-I$msgpack_inc_path"
+ MSGPACK_EXT_DIR="$msgpack_inc_path/ext"
+ ifdef([PHP_ADD_EXTENSION_DEP],
+ [
+ PHP_ADD_EXTENSION_DEP(redis, msgpack)
+ ])
+ PHP_ADD_INCLUDE($MSGPACK_EXT_DIR)
+ fi
else
MSGPACK_INCLUDES=""
AC_MSG_RESULT([disabled])
diff --git a/library.c b/library.c
index ef7f579d..ca48100f 100644
--- a/library.c
+++ b/library.c
@@ -2245,14 +2245,7 @@ redis_unserialize(RedisSock* redis_sock, const char *val, int val_len,
case REDIS_SERIALIZER_MSGPACK:
#ifdef HAVE_REDIS_MSGPACK
- /*
- * Would like to be able to check to see if a string is msgpack'd (like with igbinary, below),
- * but I don't believe there's an easy way to do that as there's no consistent header or
- * other simple indication of packed-ness in msgpacked binary sequences, as far as I know.
- */
-
- php_msgpack_unserialize(z_ret, (char *)val, (size_t)val_len TSRMLS_CC);
- ret = 1;
+ ret = !php_msgpack_unserialize(z_ret, (char *)val, (size_t)val_len TSRMLS_CC);
#endif
break;