Fix libmemcached 0.32 support

This commit is contained in:
lericson 2010-06-03 21:13:30 +02:00
parent 25396a64bd
commit 91c7b3fd56

View File

@ -1072,11 +1072,14 @@ memcached_return pylibmc_memcached_fetch_multi(
for (*nresults = 0; ; (*nresults)++) { for (*nresults = 0; ; (*nresults)++) {
pylibmc_mget_result *res = *results + *nresults; pylibmc_mget_result *res = *results + *nresults;
/* if loop spins out of control, this fails */
assert(nkeys >= (*nresults));
res->value = memcached_fetch(mc, res->key, &res->key_len, res->value = memcached_fetch(mc, res->key, &res->key_len,
&res->value_len, &res->flags, &rc); &res->value_len, &res->flags, &rc);
assert(res->value_len < MEMCACHED_MAX_KEY); assert(res->value_len < MEMCACHED_MAX_KEY);
if (res->value == NULL && rc == MEMCACHED_END) { if (res->value == NULL || rc == MEMCACHED_END) {
/* This is how libmecached signals EOF. */ /* This is how libmecached signals EOF. */
break; break;
} else if (rc == MEMCACHED_BAD_KEY_PROVIDED } else if (rc == MEMCACHED_BAD_KEY_PROVIDED