Skip to content

Commit

Permalink
Fallback to doing a get when noreply is set to true to avoid
Browse files Browse the repository at this point in the history
waiting forever for a response.
  • Loading branch information
ccocchi committed Sep 6, 2012
1 parent 1845a64 commit e91e8b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ext/libmemcached-0.32/libmemcached/memcached_exist.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ memcached_return memcached_exist_by_key(memcached_st *ptr,
if (ptr->number_of_hosts == 0)
return MEMCACHED_NO_SERVERS;

if (ptr->flags & MEM_NOREPLY)
{
size_t dummy_length;
uint32_t dummy_flags;
memcached_return dummy_error;

memcached_get(ptr, key, key_length, &dummy_length, &dummy_flags, &dummy_error);
return dummy_error;
}

unsigned int server_key= memcached_generate_hash(ptr, key, key_length);
memcached_server_st *server= &ptr->hosts[server_key];

Expand Down

0 comments on commit e91e8b9

Please sign in to comment.