Fixed testapp so that we can test just selections of tests.
Fixed issue in IO, where in non-blocking mode it was possible not to write
out a response (aka, we didn't properly flush buffers before exiting).
return MEMCACHED_FAILURE;
return MEMCACHED_SUCCESS;
-#ifdef OLD
- while (1)
- {
- int select_return;
- struct timeval local_tv;
- fd_set set;
-
- memset(&local_tv, 0, sizeof(struct timeval));
-
- local_tv.tv_sec= 0;
- local_tv.tv_usec= 300;
-
- FD_ZERO(&set);
- FD_SET(ptr->hosts[server_key].fd, &set);
-
- if (read_or_write)
- select_return= select(1, &set, NULL, NULL, &local_tv);
- else
- select_return= select(1, NULL, &set, NULL, &local_tv);
-
- if (select_return == -1)
- {
- ptr->my_errno= errno;
- return MEMCACHED_FAILURE;
- }
- else if (!select_return)
- break;
- }
-
- return MEMCACHED_SUCCESS;
-#endif
}
ssize_t memcached_io_read(memcached_st *ptr, unsigned int server_key,
}
sent_length= 0;
-#ifdef orig
- if ((sent_length= send(ptr->hosts[server_key].fd, write_ptr,
- write_length, 0)) == -1)
-#endif
- if ((sent_length= write(ptr->hosts[server_key].fd, write_ptr,
- write_length)) == -1)
+ if ((sent_length= write(ptr->hosts[server_key].fd, write_ptr,
+ write_length)) == -1)
{
switch (errno)
{
{
if (ptr->hosts[server_key].fd != -1)
{
- if (ptr->flags & MEM_NO_BLOCK)
- memcached_io_write(ptr, server_key, "quit\r\n", 6, 1);
+ if (ptr->flags & MEM_NO_BLOCK && ptr->hosts[server_key].stack_responses)
+ memcached_io_flush(ptr, server_key);
+
+ memcached_io_write(ptr, server_key, "quit\r\n", 6, 1);
+
close(ptr->hosts[server_key].fd);
ptr->hosts[server_key].fd= -1;
ptr->hosts[server_key].stack_responses= 0;
size_t string_length;
uint16_t flags;
+ rc= memcached_delete(memc, key, strlen(key), (time_t)0);
+ assert(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_NOTFOUND);
+
string= memcached_get(memc, key, strlen(key),
&string_length, &flags, &rc);
}
}
-#define KEY_COUNT 2000 // * 1024576
+/* Do a large mget() over all the keys we think exist */
+#define KEY_COUNT 3000 // * 1024576
void user_supplied_bug3(memcached_st *memc)
{
memcached_return rc;
memset(keys, 0, (sizeof(char *) * KEY_COUNT));
for (x= 0; x < KEY_COUNT; x++)
{
- char buffer[20];
+ char buffer[30];
snprintf(buffer, 30, "%u", x);
keys[x]= strdup(buffer);
char *wildcard= NULL;
memcached_server_st *servers;
- if (argc > 2)
+ if (argc > 1)
test_to_run= argv[1];
if (argc == 3)
test_st user_tests[] ={
{"user_supplied_bug1", 0, user_supplied_bug1 },
{"user_supplied_bug2", 0, user_supplied_bug2 },
- {"user_supplied_bug3", 0, user_supplied_bug3 },
+// {"user_supplied_bug3", 0, user_supplied_bug3 },
{0, 0, 0}
};