Fix binary touch.
authorBrian Aker <brian@tangent.org>
Tue, 29 Jan 2013 00:21:30 +0000 (19:21 -0500)
committerBrian Aker <brian@tangent.org>
Tue, 29 Jan 2013 00:21:30 +0000 (19:21 -0500)
libmemcached/response.cc
tests/libmemcached-1.0/touch.cc

index cf7ed41e6936492c0d6c44c3532b4cfdfb74b646..96772ff380ac064d6182da66dd94ae6f89f04c97 100644 (file)
@@ -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;
       }
 
index 9bd562a2daf10923cfd4aa60cb9b61713c939d7c..044273fd4d0a2d5a7c3033bfebdc598d614a27f8 100644 (file)
@@ -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"),