Skip to content

Commit e99fda8

Browse files
committed
Working now
1 parent fd687b7 commit e99fda8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: php_memcached.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ PHP_INI_MH(OnUpdateConsistentHash)
333333
} else if (!strcmp(ZSTR_VAL(new_value), "ketama_weighted")) {
334334
MEMC_SESS_INI(consistent_hash_type) = MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED;
335335
} else {
336-
php_error_docref(NULL, E_WARNING, "memcached.consistent_has_type must be ketama or ketama_weighted");
336+
php_error_docref(NULL, E_WARNING, "memcached.sess_consistent_hash_type must be ketama or ketama_weighted");
337337
return FAILURE;
338338
}
339339
return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
@@ -373,7 +373,7 @@ PHP_INI_BEGIN()
373373
MEMC_SESSION_INI_BOOL ("binary_protocol", "1", OnUpdateBool, binary_protocol_enabled)
374374
#endif
375375
MEMC_SESSION_INI_BOOL ("consistent_hash", "1", OnUpdateBool, consistent_hash_enabled)
376-
MEMC_SESSION_INI_ENTRY("consistent_hash_type", "ketama", OnUpdateConsistentHash, consistent_hash_type)
376+
MEMC_SESSION_INI_ENTRY("consistent_hash_type", "ketama", OnUpdateConsistentHash, consistent_hash_name)
377377
MEMC_SESSION_INI_ENTRY("number_of_replicas", "0", OnUpdateLongGEZero, number_of_replicas)
378378
MEMC_SESSION_INI_BOOL ("randomize_replica_read", "0", OnUpdateBool, randomize_replica_read_enabled)
379379
MEMC_SESSION_INI_BOOL ("remove_failed_servers", "0", OnUpdateBool, remove_failed_servers_enabled)
@@ -1271,7 +1271,6 @@ static PHP_METHOD(Memcached, __construct)
12711271

12721272
/* Set default behaviors */
12731273
if (MEMC_G(default_behavior.consistent_hash_enabled)) {
1274-
12751274
memcached_return rc = memcached_behavior_set(intern->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, MEMCACHED_DISTRIBUTION_CONSISTENT);
12761275
if (rc != MEMCACHED_SUCCESS) {
12771276
php_error_docref(NULL, E_WARNING, "Failed to turn on consistent hash: %s", memcached_strerror(intern->memc, rc));

Diff for: php_memcached_private.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
156156

157157
zend_bool binary_protocol_enabled;
158158
zend_bool consistent_hash_enabled;
159-
int consistent_hash_type;
159+
char *consistent_hash_name;
160+
int consistent_hash_type;
160161

161162
zend_long server_failure_limit;
162163
zend_long number_of_replicas;

0 commit comments

Comments
 (0)