{
stat->threads= strtol(value, (char **)NULL, 10);
}
- else
+ else if (!(strcmp("delete_misses", key) == 0 ||/* New stats in the 1.3 beta */
+ strcmp("delete_hits", key) == 0 ||/* Just swallow them for now.. */
+ strcmp("incr_misses", key) == 0 ||
+ strcmp("incr_hits", key) == 0 ||
+ strcmp("decr_misses", key) == 0 ||
+ strcmp("decr_hits", key) == 0 ||
+ strcmp("cas_misses", key) == 0 ||
+ strcmp("cas_hits", key) == 0 ||
+ strcmp("cas_badval", key) == 0 ||
+ strcmp("cmd_flush", key) == 0 ||
+ strcmp("accepting_conns", key) == 0 ||
+ strcmp("listen_disabled_num", key) == 0))
{
fprintf(stderr, "Unknown key %s\n", key);
}
}
char *memcached_stat_get_value(memcached_st *ptr, memcached_stat_st *stat,
- char *key, memcached_return *error)
+ const char *key, memcached_return *error)
{
char buffer[SMALL_STRING_LEN];
size_t length;
if (args != NULL)
{
int len= strlen(args);
+
+ rc= memcached_validate_key_length(len, true);
+ unlikely (rc != MEMCACHED_SUCCESS)
+ return rc;
+
request.message.header.request.keylen= htons((uint16_t)len);
request.message.header.request.bodylen= htonl(len);
memcached_return rc;
memcached_stat_st *stats;
+ if (ptr->flags & MEM_USE_UDP)
+ {
+ *error= MEMCACHED_NOT_SUPPORTED;
+ return NULL;
+ }
+
if (ptr->call_malloc)
stats= (memcached_stat_st *)ptr->call_malloc(ptr, sizeof(memcached_stat_st)*(ptr->number_of_hosts));
else
if (!stats)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
- if (ptr->call_free)
- ptr->call_free(ptr, stats);
- else
- free(stats);
-
return NULL;
}
memset(stats, 0, sizeof(memcached_stat_st)*(ptr->number_of_hosts));
We make a copy of the keys since at some point in the not so distant future
we will add support for "found" keys.
*/
-char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat,
+char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat __attribute__((unused)),
memcached_return *error)
{
char **list;