uint16_t reserved;
};
+LIBMEMCACHED_LOCAL
ssize_t memcached_io_write(memcached_server_st *ptr,
const void *buffer, size_t length, char with_flush);
+LIBMEMCACHED_LOCAL
void memcached_io_reset(memcached_server_st *ptr);
+LIBMEMCACHED_LOCAL
memcached_return_t memcached_io_read(memcached_server_st *ptr,
void *buffer, size_t length, ssize_t *nread);
/* Read a line (terminated by '\n') into the buffer */
+LIBMEMCACHED_LOCAL
memcached_return_t memcached_io_readline(memcached_server_st *ptr,
char *buffer_ptr,
size_t size);
+LIBMEMCACHED_LOCAL
memcached_return_t memcached_io_close(memcached_server_st *ptr);
/* Read n bytes of data from the server and store them in dta */
+LIBMEMCACHED_LOCAL
memcached_return_t memcached_safe_read(memcached_server_st *ptr,
void *dta,
size_t size);
/* Read a single response from the server */
+LIBMEMCACHED_LOCAL
memcached_return_t memcached_read_one_response(memcached_server_st *ptr,
char *buffer, size_t buffer_length,
memcached_result_st *result);
+LIBMEMCACHED_LOCAL
memcached_return_t memcached_io_init_udp_header(memcached_server_st *ptr,
uint16_t thread_id);
+LIBMEMCACHED_LOCAL
memcached_server_st *memcached_io_get_readable_server(memcached_st *memc);
#endif /* BUILDING_LIBMEMCACHED */
stats= ptr->call_calloc(ptr, ptr->number_of_hosts, sizeof(memcached_stat_st));
+ stats->root= ptr;
+
if (!stats)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return;
}
- if (ptr)
+ if (memc_stat->root)
+ {
+ memc_stat->root->call_free(ptr, memc_stat);
+ }
+ else if (ptr)
+ {
ptr->call_free(ptr, memc_stat);
+ }
else
+ {
free(memc_stat);
+ }
}
* Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text.
*
- * Summary: Change the behavior of the memcached connection.
+ * Summary: Collect up the stats for a memcached server.
*
*/
uint64_t get_misses;
uint64_t limit_maxbytes;
char version[MEMCACHED_VERSION_STRING_LENGTH];
+ memcached_st *root;
};
LIBMEMCACHED_API