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
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;
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;
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;
return sock_size;
}
+ case MEMCACHED_BEHAVIOR_USER_DATA:
+ return MEMCACHED_FAILURE;
}
WATCHPOINT_ASSERT(temp_flag); /* Programming mistake if it gets this far */
&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));