From: Brian Aker Date: Sat, 12 Feb 2011 09:32:21 +0000 (-0800) Subject: Add purge before get. X-Git-Tag: 0.51~43^2~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5978e22206f36565d27a4d513962832f92955652;p=m6w6%2Flibmemcached Add purge before get. --- diff --git a/libmemcached/flush_buffers.c b/libmemcached/flush_buffers.c index 0a902757..649db983 100644 --- a/libmemcached/flush_buffers.c +++ b/libmemcached/flush_buffers.c @@ -17,8 +17,11 @@ memcached_return_t memcached_flush_buffers(memcached_st *memc) WATCHPOINT_ERROR(ret); return ret; } + if (memcached_io_write(instance, NULL, 0, true) == -1) + { ret= MEMCACHED_SOME_ERRORS; + } } } diff --git a/tests/mem_functions.c b/tests/mem_functions.c index 4253c988..76f7d6ee 100644 --- a/tests/mem_functions.c +++ b/tests/mem_functions.c @@ -3476,6 +3476,9 @@ static test_return_t mget_read(memcached_st *memc) { memcached_return_t rc; + rc= memcached_flush_buffers(memc); + test_true_got(rc == MEMCACHED_SUCCESS, memcached_strerror(NULL, rc)); + rc= memcached_mget(memc, global_keys, global_keys_length, global_count); if (rc == MEMCACHED_SUCCESS || MEMCACHED_SOME_ERRORS) {