0.26
* Fix for decrement on hash key
+ * Fixed assert that was catching bad memset() call in host_reset()
0.25 Fri Nov 28 09:59:35 PST 2008
* Jenkins HASH added.
const char *hostname, unsigned int port, uint32_t weight,
memcached_connection type)
{
- memset(host, 0, sizeof(memcached_server_st));
strncpy(host->hostname, hostname, MEMCACHED_MAX_HOST_LENGTH - 1);
host->root= ptr ? ptr : NULL;
host->port= port;
}
else
{
+ ptr->is_allocated= MEMCACHED_USED;
memset(ptr, 0, sizeof(memcached_server_st));
}
void memcached_server_free(memcached_server_st *ptr)
{
- memcached_return rc;
+ WATCHPOINT_NUMBER(ptr->port);
WATCHPOINT_ASSERT(ptr->is_allocated != MEMCACHED_NOT_ALLOCATED);
memcached_quit_server(ptr, 0);
else
free(ptr);
}
- else
- ptr->is_allocated= MEMCACHED_USED;
}
/*
return 0;
}
+/*
+ From Andrei on IRC
+*/
+
+test_return user_supplied_bug19(memcached_st *memc)
+{
+ memcached_st *m;
+ memcached_server_st *s;
+ memcached_return res;
+
+ (void)memc;
+
+ m= memcached_create(NULL);
+ memcached_server_add_with_weight(m, "localhost", 11311, 100);
+ memcached_server_add_with_weight(m, "localhost", 11312, 100);
+
+ s= memcached_server_by_key(m, "a", 1, &res);
+ memcached_server_free(s);
+
+ memcached_free(m);
+}
+
#include "ketama_test_cases.h"
test_return user_supplied_bug18(memcached_st *memc)
{
{"user_supplied_bug16", 1, user_supplied_bug16 },
{"user_supplied_bug17", 1, user_supplied_bug17 },
// {"user_supplied_bug18", 1, user_supplied_bug18 },
+ {"user_supplied_bug19", 1, user_supplied_bug19 },
{0, 0, 0}
};