From: Date: Fri, 9 Jan 2009 09:21:54 +0000 (+0200) Subject: Change binary protocol behavior to disallow the use of key verification. (We disable... X-Git-Tag: 0.26~21^2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=87d2e51b980627c645893d5c115bb0d9c132911f;p=awesomized%2Flibmemcached Change binary protocol behavior to disallow the use of key verification. (We disable key verification in case setting binary-protocol behavior, and disallow setting key verification behavior in case binary protocol is already in use. Motivation for this is to allow the use of arbitrary key content i.e. non-ascii --- diff --git a/libmemcached/memcached_behavior.c b/libmemcached/memcached_behavior.c index 5f688440..fc785e25 100644 --- a/libmemcached/memcached_behavior.c +++ b/libmemcached/memcached_behavior.c @@ -40,6 +40,8 @@ memcached_return memcached_behavior_set(memcached_st *ptr, ptr->server_failure_limit= (uint32_t)data; break; case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL: + if (data) + set_behavior_flag(ptr, MEM_VERIFY_KEY, 0); set_behavior_flag(ptr, MEM_BINARY_PROTOCOL, data); break; case MEMCACHED_BEHAVIOR_SUPPORT_CAS: @@ -101,6 +103,8 @@ memcached_return memcached_behavior_set(memcached_st *ptr, memcached_quit(ptr); break; case MEMCACHED_BEHAVIOR_VERIFY_KEY: + if (ptr->flags & MEM_BINARY_PROTOCOL) + break; set_behavior_flag(ptr, MEM_VERIFY_KEY, data); break; case MEMCACHED_BEHAVIOR_SORT_HOSTS: