summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Aker <brian@tangent.org>2013-01-28 19:21:30 -0500
committerBrian Aker <brian@tangent.org>2013-01-28 19:21:30 -0500
commit53aa3021fa0dea4c4bebdd05b7f7c5a212184e69 (patch)
tree01525a6803f83dd564c940d5d80d03055d00d82a
parent743e893ecbbaacd66d2832e9c3ae16404422a173 (diff)
downloadlibmemcached-53aa3021fa0dea4c4bebdd05b7f7c5a212184e69.tar.gz
Fix binary touch.
-rw-r--r--libmemcached/response.cc6
-rw-r--r--tests/libmemcached-1.0/touch.cc3
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"),