Skip to content

Instantly share code, notes, and snippets.

@bobrik
Created October 12, 2011 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobrik/1280799 to your computer and use it in GitHub Desktop.
Save bobrik/1280799 to your computer and use it in GitHub Desktop.
memcached module for php with backward compatibility hacks
diff --git a/php_memcached.c b/php_memcached.c
index aecdc4f..7ad6c0d 100644
--- a/php_memcached.c
+++ b/php_memcached.c
@@ -115,17 +115,17 @@ typedef unsigned long int uint32_t;
/****************************************
Payload value flags
****************************************/
-#define MEMC_VAL_TYPE_MASK 0xf
+#define MEMC_VAL_TYPE_MASK 0x2f
#define MEMC_VAL_GET_TYPE(flags) ((flags) & MEMC_VAL_TYPE_MASK)
#define MEMC_VAL_SET_TYPE(flags, type) ((flags) |= ((type) & MEMC_VAL_TYPE_MASK))
#define MEMC_VAL_IS_STRING 0
-#define MEMC_VAL_IS_LONG 1
-#define MEMC_VAL_IS_DOUBLE 2
-#define MEMC_VAL_IS_BOOL 3
-#define MEMC_VAL_IS_SERIALIZED 4
-#define MEMC_VAL_IS_IGBINARY 5
-#define MEMC_VAL_IS_JSON 6
+#define MEMC_VAL_IS_LONG 4
+#define MEMC_VAL_IS_DOUBLE 8
+#define MEMC_VAL_IS_BOOL 32
+#define MEMC_VAL_IS_SERIALIZED 1
+#define MEMC_VAL_IS_IGBINARY 100
+#define MEMC_VAL_IS_JSON 101
#define MEMC_VAL_COMPRESSED (1<<4)
#define MEMC_VAL_COMPRESSION_ZLIB (1<<5)
@bobrik
Copy link
Author

bobrik commented Oct 12, 2011

пока тут полежит, как можно будет наконец зафоркать оригинальный репозиторий, так всё пойдёт туда.

компрессия несовместима пока что.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment