lookups).
0.10
* Added append binary test.
+ * Added MEMCACHED_BEHAVIOR_CACHE_LOOKUPS behavior so that you can save on
+ multiple DNS lookups.
0.9 Thu Nov 15 07:44:00 PST 2007
* fix for when no servers are definied.
Makes the default hashing algorithm for keys use MD5. The value can be set to either MEMCACHED_HASH_DEFAULT, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_KETAMA. The behavior for all hashes but MEMCACHED_HASH_DEFAULT is identitical to the Java driver written by Dustin Sallings.
+=item MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
+
+Memcached can cache named lookups so that DNS lookups are made only once.
=back
MEMCACHED_BEHAVIOR_KETAMA,
MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE,
MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE,
+ MEMCACHED_BEHAVIOR_CACHE_LOOKUPS,
} memcached_behavior;
typedef enum {
MEM_USE_MD5= (1 << 3),
MEM_USE_KETAMA= (1 << 4),
MEM_USE_CRC= (1 << 5),
+ MEM_USE_CACHE_LOOKUPS= (1 << 6),
} memcached_flags;
/* Hashing algo */
case MEMCACHED_BEHAVIOR_HASH:
ptr->hash= *(memcached_hash *)(data);
break;
+ case MEMCACHED_BEHAVIOR_CACHE_LOOKUPS:
+ set_behavior_flag(ptr, MEM_USE_CACHE_LOOKUPS, data);
+ break;
case MEMCACHED_BEHAVIOR_KETAMA:
set_behavior_flag(ptr, MEM_USE_KETAMA, data);
break;
switch (flag)
{
+ case MEMCACHED_BEHAVIOR_CACHE_LOOKUPS:
+ temp_flag= MEM_USE_CACHE_LOOKUPS;
+ break;
case MEMCACHED_BEHAVIOR_NO_BLOCK:
temp_flag= MEM_NO_BLOCK;
break;
/* Old connection junk still is in the structure */
WATCHPOINT_ASSERT(ptr->hosts[server_key].stack_responses == 0);
- if (ptr->hosts[server_key].sockaddr_inited == MEMCACHED_NOT_ALLOCATED)
+ /*
+ If we have not allocated the hosts object.
+ Or if the cache has not been set.
+ */
+ if (ptr->hosts[server_key].sockaddr_inited == MEMCACHED_NOT_ALLOCATED ||
+ (!(ptr->flags & MEM_USE_CACHE_LOOKUPS)))
{
memcached_return rc;