X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fauto.cc;h=adce334873fe69b15bc0abe8ec6abfe195d313ec;hb=7d698ad128550cb4d2e3a60c83533c4370efd106;hp=9d85ad434858897556244f0447f0564cfddadaf5;hpb=59e77031ba00e924cb7f8a2863e858f10cbcb9f8;p=m6w6%2Flibmemcached diff --git a/libmemcached/auto.cc b/libmemcached/auto.cc index 9d85ad43..adce3348 100644 --- a/libmemcached/auto.cc +++ b/libmemcached/auto.cc @@ -83,7 +83,7 @@ static memcached_return_t text_incr_decr(memcached_server_write_instance_st inst { memcached_literal_param("incr ") }, { memcached_array_string(instance->root->_namespace), memcached_array_size(instance->root->_namespace) }, { key, key_length }, - { buffer, send_length }, + { buffer, size_t(send_length) }, { " noreply", reply ? 0 : memcached_literal_param_size(" noreply") }, { memcached_literal_param("\r\n") } }; @@ -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);