X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fresponse.c;h=cbb49784b18d1cb270e519f6db56ddc5a8255ba7;hb=7e592f0e6938506a8f9e228b40557c5bb8a10a0b;hp=dafdbbc40128da37fdc89c7fdddfedf6f6f70cf9;hpb=b70595336b2914550af90318eca857dfb02d72de;p=m6w6%2Flibmemcached diff --git a/libmemcached/response.c b/libmemcached/response.c index dafdbbc4..cbb49784 100644 --- a/libmemcached/response.c +++ b/libmemcached/response.c @@ -25,7 +25,10 @@ memcached_return_t memcached_read_one_response(memcached_server_instance_st *ptr memcached_server_response_decrement(ptr); if (result == NULL) - result = &ptr->root->result; + { + memcached_st *root= (memcached_st *)ptr->root; + result = &root->result; + } memcached_return_t rc; if (ptr->root->flags.binary_protocol) @@ -107,7 +110,7 @@ static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr, char *key; size_t prefix_length; - key= result->key; + key= result->item_key; result->key_length= 0; for (prefix_length= ptr->root->prefix_key_length; !(iscntrl(*string_ptr) || isspace(*string_ptr)) ; string_ptr++) @@ -121,7 +124,7 @@ static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr, else prefix_length--; } - result->key[result->key_length]= 0; + result->item_key[result->key_length]= 0; } if (end_ptr == string_ptr) @@ -132,7 +135,7 @@ static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr, if (end_ptr == string_ptr) goto read_error; for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++); - result->flags= (uint32_t) strtoul(next_ptr, &string_ptr, 10); + result->item_flags= (uint32_t) strtoul(next_ptr, &string_ptr, 10); if (end_ptr == string_ptr) goto read_error; @@ -158,7 +161,7 @@ static memcached_return_t textual_value_fetch(memcached_server_instance_st *ptr, { string_ptr++; for (next_ptr= string_ptr; isdigit(*string_ptr); string_ptr++); - result->cas= strtoull(next_ptr, &string_ptr, 10); + result->item_cas= strtoull(next_ptr, &string_ptr, 10); } if (end_ptr < string_ptr) @@ -256,9 +259,9 @@ static memcached_return_t textual_read_one_response(memcached_server_instance_st memory in the struct, which is important, for something that rarely should happen? */ - rel_ptr= (char *)ptr->root->call_realloc(ptr->root, - ptr->cached_server_error, - (size_t) (endptr - startptr + 1)); + rel_ptr= (char *)libmemcached_realloc(ptr->root, + ptr->cached_server_error, + (size_t) (endptr - startptr + 1)); if (rel_ptr == NULL) { @@ -361,17 +364,17 @@ static memcached_return_t binary_read_one_response(memcached_server_instance_st { uint16_t keylen= header.response.keylen; memcached_result_reset(result); - result->cas= header.response.cas; + result->item_cas= header.response.cas; - if (memcached_safe_read(ptr, &result->flags, - sizeof (result->flags)) != MEMCACHED_SUCCESS) + if (memcached_safe_read(ptr, &result->item_flags, + sizeof (result->item_flags)) != MEMCACHED_SUCCESS) return MEMCACHED_UNKNOWN_READ_FAILURE; - result->flags= ntohl(result->flags); + result->item_flags= ntohl(result->item_flags); bodylen -= header.response.extlen; result->key_length= keylen; - if (memcached_safe_read(ptr, result->key, keylen) != MEMCACHED_SUCCESS) + if (memcached_safe_read(ptr, result->item_key, keylen) != MEMCACHED_SUCCESS) return MEMCACHED_UNKNOWN_READ_FAILURE; bodylen -= keylen;