memcached_return run_distribution(memcached_st *ptr);
+uint32_t generate_hash_value(const char *key, size_t key_length, memcached_hash hash_algorithm);
+
uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length);
#endif /* __COMMON_H__ */
if (ptr->root->flags & MEM_NO_BLOCK)
{
int error;
- struct linger linger;
struct timeval waittime;
waittime.tv_sec= 10;
waittime.tv_usec= 0;
- linger.l_onoff= 1;
- linger.l_linger= MEMCACHED_DEFAULT_TIMEOUT;
- error= setsockopt(ptr->fd, SOL_SOCKET, SO_LINGER,
- &linger, (socklen_t)sizeof(struct linger));
- WATCHPOINT_ASSERT(error == 0);
-
error= setsockopt(ptr->fd, SOL_SOCKET, SO_SNDTIMEO,
&waittime, (socklen_t)sizeof(struct timeval));
WATCHPOINT_ASSERT(error == 0);
WATCHPOINT_ASSERT(error == 0);
}
+ {
+ int error;
+ struct linger linger;
+
+ linger.l_onoff= 1;
+ linger.l_linger= MEMCACHED_DEFAULT_TIMEOUT;
+ error= setsockopt(ptr->fd, SOL_SOCKET, SO_LINGER,
+ &linger, (socklen_t)sizeof(struct linger));
+ WATCHPOINT_ASSERT(error == 0);
+ }
+
if (ptr->root->flags & MEM_TCP_NODELAY)
{
int flag= 1;
uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_length)
{
uint32_t hash= 1; /* Just here to remove compile warning */
- uint32_t result= 1;
WATCHPOINT_ASSERT(ptr->number_of_hosts);
qsort(ptr->continuum, ptr->number_of_hosts * MEMCACHED_POINTS_PER_SERVER, sizeof(memcached_continuum_item_st), continuum_item_cmp);
ptr->continuum_points_counter= pointer_counter;
- memcached_stat_free(NULL, stat_p);
+ if (stat_p)
+ memcached_stat_free(NULL, stat_p);
#ifdef HAVE_DEBUG
for (index= 0; index < ((ptr->number_of_hosts * MEMCACHED_POINTS_PER_SERVER) - 1); index++)