0.17
* MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT added for connect timeout in
non-block mode.
+ * Fix plus tests for non-zero value objects and flags.
0.16 Mon Feb 18 00:30:25 PST 2008
* Work on the UDP protocol
WATCHPOINT_ASSERT(string->is_allocated != MEMCACHED_USED);
+ if (memcached_string_length(string) == 0)
+ return NULL;
+
if (string->root->call_malloc)
c_ptr= (char *)string->root->call_malloc(string->root, (memcached_string_length(string)+1) * sizeof(char));
else
return 0;
}
+/*
+ Look for zero length value problems
+ */
+uint8_t user_supplied_bug15(memcached_st *memc)
+{
+ uint32_t x;
+ memcached_return rc;
+ char *key= "mykey";
+ char *value;
+ size_t length;
+ uint32_t flags;
+
+ for (x= 0; x < 2; x++)
+ {
+ rc= memcached_set(memc, key, strlen(key),
+ NULL, 0,
+ (time_t)0, (uint32_t)0);
+
+ assert(rc == MEMCACHED_SUCCESS);
+
+ value= memcached_get(memc, key, strlen(key),
+ &length, &flags, &rc);
+
+ assert(rc == MEMCACHED_SUCCESS);
+ assert(value == NULL);
+ assert(length == 0);
+ assert(flags == 0);
+
+ value= memcached_get(memc, key, strlen(key),
+ &length, &flags, &rc);
+
+ assert(rc == MEMCACHED_SUCCESS);
+ assert(value == NULL);
+ assert(length == 0);
+ assert(flags == 0);
+ }
+
+ return 0;
+}
+
uint8_t result_static(memcached_st *memc)
{
memcached_result_st result;
{"user_supplied_bug12", 1, user_supplied_bug12 },
{"user_supplied_bug13", 1, user_supplied_bug13 },
{"user_supplied_bug14", 1, user_supplied_bug14 },
+ {"user_supplied_bug15", 1, user_supplied_bug15 },
{0, 0, 0}
};