X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_get.c;h=e91db4cf363854f3aa363691c23ece90b274c8ac;hb=0d2a649b7ee8410e07f649d72266f76ea43a858e;hp=cdae9922bcb3acda7316edf9b4325516f1800a05;hpb=dd306653cdd9b09904b25dc4f7ffe7c64d9fd357;p=m6w6%2Flibmemcached diff --git a/libmemcached/memcached_get.c b/libmemcached/memcached_get.c index cdae9922..e91db4cf 100644 --- a/libmemcached/memcached_get.c +++ b/libmemcached/memcached_get.c @@ -368,11 +368,11 @@ static memcached_return replication_binary_mget(memcached_st *ptr, int flush= number_of_keys == 1; - for (int replica = 0; replica <= ptr->number_of_replicas; ++replica) + for (uint32_t replica= 0; replica <= ptr->number_of_replicas; ++replica) { bool success= true; - for (uint32_t x= 0; x < number_of_keys; ++x) + for (x= 0; x < number_of_keys; ++x) { if (hash[x] == ptr->number_of_hosts) continue; /* Already successfully sent */ @@ -443,15 +443,14 @@ static memcached_return replication_binary_mget(memcached_st *ptr, memcached_server_response_increment(&ptr->hosts[x]); /* mark all of the messages bound for this server as sent! */ - for (uint32_t x= 0; x < number_of_keys; ++x) + for (x= 0; x < number_of_keys; ++x) if (hash[x] == x) hash[x]= ptr->number_of_hosts; } } - if (success) { + if (success) break; - } } return rc; @@ -469,7 +468,9 @@ static memcached_return binary_mget_by_key(memcached_st *ptr, { rc= simple_binary_mget(ptr, master_server_key, is_master_key_set, keys, key_length, number_of_keys); - } else { + } + else + { uint32_t* hash; bool* dead_servers; @@ -484,10 +485,10 @@ static memcached_return binary_mget_by_key(memcached_st *ptr, } if (is_master_key_set) - for (unsigned int x= 0; x < number_of_keys; ++x) + for (unsigned int x= 0; x < number_of_keys; x++) hash[x]= master_server_key; else - for (unsigned int x= 0; x < number_of_keys; ++x) + for (unsigned int x= 0; x < number_of_keys; x++) hash[x]= memcached_generate_hash(ptr, keys[x], key_length[x]); rc= replication_binary_mget(ptr, hash, dead_servers, keys,