X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fversion.c;h=91e926e30b0f40db7756205f4318d5da0f6ea771;hb=178083badd2dcd43bdd6b01dd2eb062ac8e37303;hp=db2419cfab3ef927a38e130348d6ab598bfe906b;hpb=7c7750f02368b570353ea109f23a0ea26d226e02;p=m6w6%2Flibmemcached diff --git a/libmemcached/version.c b/libmemcached/version.c index db2419cf..91e926e3 100644 --- a/libmemcached/version.c +++ b/libmemcached/version.c @@ -31,7 +31,7 @@ static inline memcached_return_t memcached_version_textual(memcached_st *ptr) send_length= strlen(command); rc= MEMCACHED_SUCCESS; - for (x= 0; x < ptr->number_of_hosts; x++) + for (x= 0; x < memcached_server_count(ptr); x++) { memcached_return_t rrc; @@ -75,7 +75,7 @@ static inline memcached_return_t memcached_version_binary(memcached_st *ptr) request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES; rc= MEMCACHED_SUCCESS; - for (x= 0; x < ptr->number_of_hosts; x++) + for (x= 0; x < memcached_server_count(ptr); x++) { memcached_return_t rrc; @@ -88,7 +88,8 @@ static inline memcached_return_t memcached_version_binary(memcached_st *ptr) } } - for (x= 0; x < ptr->number_of_hosts; x++) + for (x= 0; x < memcached_server_count(ptr); x++) + { if (memcached_server_response_count(&ptr->hosts[x]) > 0) { memcached_return_t rrc; @@ -107,6 +108,7 @@ static inline memcached_return_t memcached_version_binary(memcached_st *ptr) ptr->hosts[x].minor_version= (uint8_t)strtol(p + 1, &p, 10); ptr->hosts[x].micro_version= (uint8_t)strtol(p + 1, NULL, 10); } + } return rc; }