Add a request id for each request that hits the wire.
[m6w6/libmemcached] / libmemcached / auto.cc
index 9d85ad434858897556244f0447f0564cfddadaf5..3054368bc965d7f1fb80205a5a16adb07742f66f 100644 (file)
@@ -118,7 +118,8 @@ static memcached_return_t binary_incr_decr(memcached_server_write_instance_st in
   }
   protocol_binary_request_incr request= {}; // = {.bytes= {0}};
 
-  request.message.header.request.magic= PROTOCOL_BINARY_REQ;
+  initialize_binary_request(instance, request.message.header);
+
   request.message.header.request.opcode= cmd;
   request.message.header.request.keylen= htons((uint16_t)(key_length + memcached_array_size(instance->root->_namespace)));
   request.message.header.request.extlen= 20;
@@ -166,6 +167,12 @@ static memcached_return_t increment_decrement_by_key(const protocol_binary_comma
     return rc;
   }
 
+  if (memcached_is_encrypted(memc))
+  {
+    return memcached_set_error(*memc, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT, 
+                               memcached_literal_param("Operation not allowed while encyrption is enabled"));
+  }
+
   if (memcached_failed(rc= memcached_key_test(*memc, (const char **)&key, &key_length, 1)))
   {
     return memcached_last_error(memc);
@@ -219,6 +226,12 @@ static memcached_return_t increment_decrement_with_initial_by_key(const protocol
     return rc;
   }
 
+  if (memcached_is_encrypted(memc))
+  {
+    return memcached_set_error(*memc, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT, 
+                               memcached_literal_param("Operation not allowed while encyrption is enabled"));
+  }
+
   if (memcached_failed(rc= memcached_key_test(*memc, (const char **)&key, &key_length, 1)))
   {
     return memcached_last_error(memc);