From: Brian Aker Date: Mon, 17 Mar 2008 05:18:16 +0000 (-0700) Subject: Final cleanup to remove deprecated BEHAVIOR bit for USER_DATA. X-Git-Tag: _20~1^2~46^2~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=782022334b6858af9a52587e31ab5a556927254c;p=m6w6%2Flibmemcached Final cleanup to remove deprecated BEHAVIOR bit for USER_DATA. --- diff --git a/docs/memcached_behavior.pod b/docs/memcached_behavior.pod index 2268e845..1d860c61 100755 --- a/docs/memcached_behavior.pod +++ b/docs/memcached_behavior.pod @@ -109,7 +109,7 @@ connection. memcached_behavior_get() returns either the current value of the get, or 0 or 1 on simple flag behaviors (1 being enabled). memcached_behavior_set() -returns whether or not the behavior was enabled. +returns failure or success. =head1 NOTES diff --git a/libmemcached/memcached_behavior.c b/libmemcached/memcached_behavior.c index 9269439b..677e022f 100644 --- a/libmemcached/memcached_behavior.c +++ b/libmemcached/memcached_behavior.c @@ -56,9 +56,6 @@ memcached_return memcached_behavior_set(memcached_st *ptr, case MEMCACHED_BEHAVIOR_SORT_HOSTS: set_behavior_flag(ptr, MEM_USE_SORT_HOSTS, data); break; - case MEMCACHED_BEHAVIOR_USER_DATA: - ptr->user_data= data; - break; case MEMCACHED_BEHAVIOR_POLL_TIMEOUT: ptr->poll_timeout= (int32_t)data; break; @@ -76,13 +73,15 @@ memcached_return memcached_behavior_set(memcached_st *ptr, ptr->recv_size= (int32_t)data; memcached_quit(ptr); break; + case MEMCACHED_BEHAVIOR_USER_DATA: + return MEMCACHED_FAILURE; } return MEMCACHED_SUCCESS; } -unsigned long long memcached_behavior_get(memcached_st *ptr, - memcached_behavior flag) +uint64_t memcached_behavior_get(memcached_st *ptr, + memcached_behavior flag) { memcached_flags temp_flag= 0; @@ -116,8 +115,6 @@ unsigned long long memcached_behavior_get(memcached_st *ptr, case MEMCACHED_BEHAVIOR_SORT_HOSTS: temp_flag= MEM_USE_SORT_HOSTS; break; - case MEMCACHED_BEHAVIOR_USER_DATA: - return 0; case MEMCACHED_BEHAVIOR_POLL_TIMEOUT: { return (unsigned long long)ptr->poll_timeout; @@ -162,6 +159,8 @@ unsigned long long memcached_behavior_get(memcached_st *ptr, return sock_size; } + case MEMCACHED_BEHAVIOR_USER_DATA: + return MEMCACHED_FAILURE; } WATCHPOINT_ASSERT(temp_flag); /* Programming mistake if it gets this far */ diff --git a/tests/function.c b/tests/function.c index bcf08fe6..c7211703 100644 --- a/tests/function.c +++ b/tests/function.c @@ -1821,7 +1821,8 @@ uint8_t user_supplied_bug14(memcached_st *memc) &string_length, &flags, &rc); assert(rc == MEMCACHED_SUCCESS); - assert(string); + if (current_length > 0) + assert(string); assert(string_length == current_length); assert(!memcmp(string, value, string_length));