Permalink
Browse files

Merge branch 'FixIssue53' of https://github.com/Vendini/php-memcached

…into Vendini-FixIssue53

Conflicts:
	php_memcached.h
	php_memcached_session.c
  • Loading branch information...
2 parents 7bff70a + 7e3bc8b commit e781e169871fd4f14f844ce3e01860e84ec28831 @iliaal iliaal committed Mar 3, 2013
Showing with 7 additions and 17 deletions.
  1. +1 −2 php_memcached.c
  2. +2 −3 php_memcached.h
  3. +3 −10 php_memcached_session.c
  4. +1 −2 tests/experimental/moduleinfo.phpt
View
3 php_memcached.c
@@ -292,7 +292,6 @@ PHP_INI_BEGIN()
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)
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)
- STD_PHP_INI_ENTRY("memcached.sess_consistent_hashing", "0", PHP_INI_ALL, OnUpdateBool, sess_consistent_hashing_enabled, zend_php_memcached_globals, php_memcached_globals)
STD_PHP_INI_ENTRY("memcached.sess_remove_failed", "0", PHP_INI_ALL, OnUpdateBool, sess_remove_failed_enabled, zend_php_memcached_globals, php_memcached_globals)
STD_PHP_INI_ENTRY("memcached.sess_connect_timeout", "1000", PHP_INI_ALL, OnUpdateLong, sess_connect_timeout, zend_php_memcached_globals, php_memcached_globals)
#endif
@@ -3123,7 +3122,7 @@ static void php_memc_init_globals(zend_php_memcached_globals *php_memcached_glob
#ifdef HAVE_MEMCACHED_SESSION
MEMC_G(sess_locking_enabled) = 1;
MEMC_G(sess_binary_enabled) = 1;
- MEMC_G(sess_consistent_hashing_enabled) = 0;
+ MEMC_G(sess_consistent_hash_enabled) = 0;
MEMC_G(sess_number_of_replicas) = 0;
MEMC_G(sess_remove_failed_enabled) = 0;
MEMC_G(sess_prefix) = NULL;
View
5 php_memcached.h
@@ -70,8 +70,9 @@ ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
int sess_number_of_replicas;
zend_bool sess_randomize_replica_read;
zend_bool sess_remove_failed_enabled;
- zend_bool sess_consistent_hashing_enabled;
long sess_connect_timeout;
+ zend_bool sess_consistent_hash_enabled;
+ zend_bool sess_binary_enabled;
#endif
char *serializer_name;
enum memcached_serializer serializer;
@@ -84,8 +85,6 @@ ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
#if HAVE_MEMCACHED_SASL
bool use_sasl;
#endif
- zend_bool sess_consistent_hash_enabled;
- zend_bool sess_binary_enabled;
ZEND_END_MODULE_GLOBALS(php_memcached)
PHP_MEMCACHED_API zend_class_entry *php_memc_get_ce(void);
View
13 php_memcached_session.c
@@ -228,17 +228,10 @@ PS_OPEN_FUNC(memcached)
}
}
- if (MEMC_G(sess_consistent_hashing_enabled)) {
- if (memcached_behavior_set(memc_sess->memc_sess, MEMCACHED_BEHAVIOR_KETAMA, (uint64_t) 1) == MEMCACHED_FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to set memcached consistent hashing");
- return FAILURE;
- }
+ if (memcached_behavior_set(memc_sess->memc_sess, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, (uint64_t) MEMC_G(sess_connect_timeout)) == MEMCACHED_FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to set memcached connection timeout");
+ return FAILURE;
}
-
- if (memcached_behavior_set(memc_sess->memc_sess, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, (uint64_t) MEMC_G(sess_connect_timeout)) == MEMCACHED_FAILURE) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to set memcached connection timeout");
- return FAILURE;
- }
/* Allow libmemcached remove failed servers */
if (MEMC_G(sess_remove_failed_enabled)) {
View
3 tests/experimental/moduleinfo.phpt
@@ -25,10 +25,9 @@ memcached.compression_type => %s => %s
memcached.serializer => %s => %s
memcached.sess_binary => %d => %d
memcached.sess_consistent_hash => %d => %d
-memcached.sess_consistent_hashing => %d => %d
memcached.sess_lock_wait => %d => %d
memcached.sess_locking => %d => %d
memcached.sess_number_of_replicas => %d => %d
memcached.sess_prefix => %s => %s
memcached.sess_randomize_replica_read => %d => %d
-memcached.sess_remove_failed => %d => %d
+memcached.sess_remove_failed => %d => %d

0 comments on commit e781e16

Please sign in to comment.