Skip to content

Commit 0a90491

Browse files
committed
set sess_binary_protocol off by default with older libmemcached
1 parent d81697f commit 0a90491

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: memcached.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
; Use the memcached binary protocol for memcached sessions (Instead of the text protocol)
6565
; libmemcached replicas work only if binary mode is enabled.
6666
; However, certain proxies (such as twemproxy) will work only if the binary protocol is disabled.
67-
; Default is On. In older versions of php-memcached, this setting was Off and was called memcached.sess_binary.
67+
; In older versions of php-memcached, this setting was Off and was called memcached.sess_binary.
68+
; Default is On with libmemcached 1.0.18 or newer.
69+
; Default is Off with older version.
6870
;memcached.sess_binary_protocol = On
6971

7072
; memcached session replica read randomize

Diff for: php_memcached.c

+4
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,11 @@ PHP_INI_BEGIN()
332332
MEMC_SESSION_INI_ENTRY("lock_wait_max", "2000", OnUpdateLongGEZero, lock_wait_max)
333333
MEMC_SESSION_INI_ENTRY("lock_retries", "5", OnUpdateLong, lock_retries)
334334
MEMC_SESSION_INI_ENTRY("lock_expire", "0", OnUpdateLongGEZero, lock_expiration)
335+
#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX < 0x01000018
336+
MEMC_SESSION_INI_ENTRY("binary_protocol", "0", OnUpdateBool, binary_protocol_enabled)
337+
#else
335338
MEMC_SESSION_INI_ENTRY("binary_protocol", "1", OnUpdateBool, binary_protocol_enabled)
339+
#endif
336340
MEMC_SESSION_INI_ENTRY("consistent_hash", "1", OnUpdateBool, consistent_hash_enabled)
337341
MEMC_SESSION_INI_ENTRY("number_of_replicas", "0", OnUpdateLongGEZero, number_of_replicas)
338342
MEMC_SESSION_INI_ENTRY("randomize_replica_read", "0", OnUpdateLongGEZero, randomize_replica_read_enabled)

0 commit comments

Comments
 (0)