Skip to content

Commit e781e16

Browse files
committed
Merge branch 'FixIssue53' of https://github.com/Vendini/php-memcached into Vendini-FixIssue53
Conflicts: php_memcached.h php_memcached_session.c
2 parents 7bff70a + 7e3bc8b commit e781e16

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

php_memcached.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ PHP_INI_BEGIN()
292292

293293
STD_PHP_INI_ENTRY("memcached.sess_number_of_replicas", "0", PHP_INI_ALL, OnUpdateLongGEZero, sess_number_of_replicas, zend_php_memcached_globals, php_memcached_globals)
294294
STD_PHP_INI_ENTRY("memcached.sess_randomize_replica_read", "0", PHP_INI_ALL, OnUpdateBool, sess_randomize_replica_read, zend_php_memcached_globals, php_memcached_globals)
295-
STD_PHP_INI_ENTRY("memcached.sess_consistent_hashing", "0", PHP_INI_ALL, OnUpdateBool, sess_consistent_hashing_enabled, zend_php_memcached_globals, php_memcached_globals)
296295
STD_PHP_INI_ENTRY("memcached.sess_remove_failed", "0", PHP_INI_ALL, OnUpdateBool, sess_remove_failed_enabled, zend_php_memcached_globals, php_memcached_globals)
297296
STD_PHP_INI_ENTRY("memcached.sess_connect_timeout", "1000", PHP_INI_ALL, OnUpdateLong, sess_connect_timeout, zend_php_memcached_globals, php_memcached_globals)
298297
#endif
@@ -3123,7 +3122,7 @@ static void php_memc_init_globals(zend_php_memcached_globals *php_memcached_glob
31233122
#ifdef HAVE_MEMCACHED_SESSION
31243123
MEMC_G(sess_locking_enabled) = 1;
31253124
MEMC_G(sess_binary_enabled) = 1;
3126-
MEMC_G(sess_consistent_hashing_enabled) = 0;
3125+
MEMC_G(sess_consistent_hash_enabled) = 0;
31273126
MEMC_G(sess_number_of_replicas) = 0;
31283127
MEMC_G(sess_remove_failed_enabled) = 0;
31293128
MEMC_G(sess_prefix) = NULL;

php_memcached.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
7070
int sess_number_of_replicas;
7171
zend_bool sess_randomize_replica_read;
7272
zend_bool sess_remove_failed_enabled;
73-
zend_bool sess_consistent_hashing_enabled;
7473
long sess_connect_timeout;
74+
zend_bool sess_consistent_hash_enabled;
75+
zend_bool sess_binary_enabled;
7576
#endif
7677
char *serializer_name;
7778
enum memcached_serializer serializer;
@@ -84,8 +85,6 @@ ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
8485
#if HAVE_MEMCACHED_SASL
8586
bool use_sasl;
8687
#endif
87-
zend_bool sess_consistent_hash_enabled;
88-
zend_bool sess_binary_enabled;
8988
ZEND_END_MODULE_GLOBALS(php_memcached)
9089

9190
PHP_MEMCACHED_API zend_class_entry *php_memc_get_ce(void);

php_memcached_session.c

+3-10
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,10 @@ PS_OPEN_FUNC(memcached)
228228
}
229229
}
230230

231-
if (MEMC_G(sess_consistent_hashing_enabled)) {
232-
if (memcached_behavior_set(memc_sess->memc_sess, MEMCACHED_BEHAVIOR_KETAMA, (uint64_t) 1) == MEMCACHED_FAILURE) {
233-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to set memcached consistent hashing");
234-
return FAILURE;
235-
}
231+
if (memcached_behavior_set(memc_sess->memc_sess, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, (uint64_t) MEMC_G(sess_connect_timeout)) == MEMCACHED_FAILURE) {
232+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to set memcached connection timeout");
233+
return FAILURE;
236234
}
237-
238-
if (memcached_behavior_set(memc_sess->memc_sess, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, (uint64_t) MEMC_G(sess_connect_timeout)) == MEMCACHED_FAILURE) {
239-
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to set memcached connection timeout");
240-
return FAILURE;
241-
}
242235

243236
/* Allow libmemcached remove failed servers */
244237
if (MEMC_G(sess_remove_failed_enabled)) {

tests/experimental/moduleinfo.phpt

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ memcached.compression_type => %s => %s
2525
memcached.serializer => %s => %s
2626
memcached.sess_binary => %d => %d
2727
memcached.sess_consistent_hash => %d => %d
28-
memcached.sess_consistent_hashing => %d => %d
2928
memcached.sess_lock_wait => %d => %d
3029
memcached.sess_locking => %d => %d
3130
memcached.sess_number_of_replicas => %d => %d
3231
memcached.sess_prefix => %s => %s
3332
memcached.sess_randomize_replica_read => %d => %d
34-
memcached.sess_remove_failed => %d => %d
33+
memcached.sess_remove_failed => %d => %d

0 commit comments

Comments
 (0)