struct memcached_host_st {
char *hostname;
unsigned int port;
+ int fd;
memcached_host_st *next;
};
memcached_return memcached_stat_hostname(memcached_stat_st *stat, char *args,
char *hostname, unsigned int port);
memcached_return memcached_flush(memcached_st *ptr, time_t expiration);
-char *memcached_version(memcached_st *ptr, memcached_return *error);
memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbosity);
-memcached_return memcached_quit(memcached_st *ptr);
+memcached_return memcached_quit(memcached_st *ptr, char *hostname, unsigned port);
char *memcached_get(memcached_st *ptr, char *key, size_t key_length,
size_t *value_length,
uint16_t *flags,
return memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE);
}
-char *memcached_version(memcached_st *ptr, memcached_return *error)
-{
- return MEMCACHED_SUCCESS;
-}
-
memcached_return memcached_verbosity(memcached_st *ptr, unsigned int verbosity)
{
- return MEMCACHED_SUCCESS;
+ size_t send_length;
+ memcached_return rc;
+ char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
+
+ rc= memcached_connect(ptr);
+
+ send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
+ "verbosity %u\r\n", verbosity);
+
+ if ((send(ptr->fd, buffer, send_length, 0) == -1))
+ {
+ fprintf(stderr, "failed verbosity\n");
+
+ return MEMCACHED_WRITE_FAILURE;
+ }
+
+ return memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE);
}
-memcached_return memcached_quit(memcached_st *ptr)
+/*
+ When this is implemented you will be able to remove single hosts
+ from your current pool of hosts.
+*/
+memcached_return memcached_quit(memcached_st *ptr, char *hostname, unsigned port)
{
return MEMCACHED_SUCCESS;
}