memcp.pod\\r
memcached_delete.pod\\r
memcached_set.pod\\r
- memcached_version.pod\\r
+ memcached_version.pod\\r
memflush.pod\r
\r
man_MANS = libmemcached.3\\r
memcached_strerror.3\\r
memcached_quit.3\\r
memcached_verbosity.3\\r
- memcached_lib_version.3\\r
+# memcached_lib_version.3\\r
memcached_version.3\r
\r
libmemcached.3: libmemcached.pod \r
memcached_version.3: memcached_version.pod\r
pod2man -c "libmemcached" -r "" -s 3 memcached_version.pod > memcached_version.3\r
\r
-memcached_lib_version.3: memcached_version.pod\r
- pod2man -c "libmemcached" -r "" -s 3 memcached_version.pod > memcached_lib_version.3\r
+#memcached_lib_version.3: memcached_version.pod\r
+# pod2man -c "libmemcached" -r "" -s 3 memcached_version.pod > memcached_lib_version.3\r
\r
memcp.1: memcp.pod\r
pod2man -c "libmemcached" -r "" -s 1 memcp.pod > memcp.1\r
/*
So why recheck responce? Because the protocol is brain dead :)
The number returned might end up equaling one of the string
- values. Less chance of a mistake with memcmp() so we will
+ values. Less chance of a mistake with strncmp() so we will
use it. We still called memcached_response() though since it
worked its magic for non-blocking IO.
*/
- if (!memcmp(buffer, "ERROR\r\n", MEMCACHED_DEFAULT_COMMAND_SIZE))
+ if (!strncmp(buffer, "ERROR\r\n", 7))
{
*value= 0;
rc= MEMCACHED_PROTOCOL_ERROR;
}
- else if (!memcmp(buffer, "NOT_FOUND\r\n", MEMCACHED_DEFAULT_COMMAND_SIZE))
+ else if (!strncmp(buffer, "NOT_FOUND\r\n", 11))
{
*value= 0;
rc= MEMCACHED_NOTFOUND;
return 0;
}
-uint8_t version_string_test(void)
+uint8_t version_string_test(memcached_st *memc)
{
const char *version_string;
+
version_string= memcached_lib_version();
+
assert(!strcmp(version_string, LIBMEMCACHED_VERSION_STRING));
+
return 0;
}
return 0;
}
+/*
+ Bug found where incr was not returning MEMCACHED_NOTFOUND when object did not exist.
+*/
+uint8_t user_supplied_bug12(memcached_st *memc)
+{
+ memcached_return rc;
+ uint32_t flags;
+ size_t value_length;
+ char *value;
+ uint64_t number_value;
+
+ value= memcached_get(memc, "autoincrement", strlen("autoincrement"),
+ &value_length, &flags, &rc);
+ assert(value == NULL);
+ assert(rc == MEMCACHED_NOTFOUND);
+
+ rc= memcached_increment(memc, "autoincrement", strlen("autoincrement"),
+ 1, &number_value);
+
+ assert(value == NULL);
+ assert(rc == MEMCACHED_NOTFOUND);
+
+ rc= memcached_set(memc, "autoincrement", strlen("autoincrement"), "1", 1, 0, 0);
+
+ value= memcached_get(memc, "autoincrement", strlen("autoincrement"),
+ &value_length, &flags, &rc);
+ assert(value);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ rc= memcached_increment(memc, "autoincrement", strlen("autoincrement"),
+ 1, &number_value);
+ assert(number_value == 2);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ return 0;
+}
+
uint8_t result_static(memcached_st *memc)
{
memcached_result_st result;
{"user_supplied_bug9", 1, user_supplied_bug9 },
{"user_supplied_bug10", 1, user_supplied_bug10 },
{"user_supplied_bug11", 1, user_supplied_bug11 },
+ {"user_supplied_bug12", 1, user_supplied_bug12 },
{0, 0, 0}
};