a pointer set of data into the library.
0.13
+ * MEMCACHED_BEHAVIOR_USER_DATA added to store user pointer.
* Fix for failure to connect to invalidate socket.
* Patch from Marc Rossi to add --hash option for memcp, memrm, and memcat.
* Kevin's patch for fixing EOF issues during a read.
Modify the timeout value that is used by poll(). The default value is -1. An signed int pointer must be passed to memcached_behavior_set() to change this value. For memcached_behavior_get() a signed int value will be cast and returned as the unsigned long long.
-=item MEMCACHED_BUFFERED
+=item MEMCACHED_BEHAVIOR_USER_DATA
+
+This allows you to store a pointer to a specifc piece of data. This can be
+retrieved from inside of memcached_fetch_exectue(). Cloning a memcached_st
+will copy the pointer to the clone.
+
+=item MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
Enabling buffered IO causes commands to "buffer" instead of being sent. Any
action that gets data causes this buffer to be be sent to the remote
MEMCACHED_BEHAVIOR_POLL_TIMEOUT,
MEMCACHED_BEHAVIOR_DISTRIBUTION,
MEMCACHED_BEHAVIOR_BUFFER_REQUESTS,
+ MEMCACHED_BEHAVIOR_USER_DATA,
} memcached_behavior;
typedef enum {
memcached_result_st result;
memcached_hash hash;
memcached_server_distribution distribution;
+ void *user_data;
unsigned int wheel[MEMCACHED_WHEEL_SIZE];
#ifdef NOT_USED /* Future Use */
uint8_t replicas;
new_clone->poll_timeout= ptr->poll_timeout;
new_clone->distribution= ptr->distribution;
new_clone->hash= ptr->hash;
+ new_clone->user_data= ptr->user_data;
return new_clone;
}
case MEMCACHED_BEHAVIOR_KETAMA:
set_behavior_flag(ptr, MEM_USE_KETAMA, data);
break;
+ case MEMCACHED_BEHAVIOR_USER_DATA:
+ ptr->user_data= data;
+ break;
case MEMCACHED_BEHAVIOR_POLL_TIMEOUT:
{
int32_t timeout= (*((int32_t *)data));
case MEMCACHED_BEHAVIOR_KETAMA:
temp_flag= MEM_USE_KETAMA;
break;
+ case MEMCACHED_BEHAVIOR_USER_DATA:
+ return (unsigned long long)ptr->user_data;
case MEMCACHED_BEHAVIOR_POLL_TIMEOUT:
{
return (unsigned long long)ptr->poll_timeout;