From 53aa3021fa0dea4c4bebdd05b7f7c5a212184e69 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 28 Jan 2013 19:21:30 -0500 Subject: [PATCH] Fix binary touch. --- libmemcached/response.cc | 6 +++++- tests/libmemcached-1.0/touch.cc | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libmemcached/response.cc b/libmemcached/response.cc index cf7ed41e..96772ff3 100644 --- a/libmemcached/response.cc +++ b/libmemcached/response.cc @@ -658,7 +658,11 @@ static memcached_return_t binary_read_one_response(org::libmemcached::Instance* case PROTOCOL_BINARY_CMD_DELETE: case PROTOCOL_BINARY_CMD_TOUCH: { - WATCHPOINT_ASSERT(bodylen == 0); + if (bodylen != 0) + { + char touch_buffer[32]; // @todo document this number + rc= memcached_safe_read(instance, buffer, sizeof(touch_buffer)); + } return MEMCACHED_SUCCESS; } diff --git a/tests/libmemcached-1.0/touch.cc b/tests/libmemcached-1.0/touch.cc index 9bd562a2..044273fd 100644 --- a/tests/libmemcached-1.0/touch.cc +++ b/tests/libmemcached-1.0/touch.cc @@ -88,8 +88,6 @@ test_return_t test_memcached_touch(memcached_st *memc) test_compare(MEMCACHED_SUCCESS, memcached_touch(memc, test_literal_param(__func__), 60 *60)); - test_skip(false ,memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL)); - rc= memcached_touch(memc, test_literal_param(__func__), 60 *60 *24 *60); test_compare(MEMCACHED_SUCCESS, rc); @@ -140,7 +138,6 @@ test_return_t test_memcached_touch_by_key(memcached_st *memc) test_literal_param(__func__), 60 *60)); - test_skip(false ,memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL)); test_compare(MEMCACHED_SUCCESS, memcached_touch_by_key(memc, test_literal_param("grouping_key"), -- 2.30.2