strcmp("reclaimed", key) == 0))
{
WATCHPOINT_STRING(key);
- return MEMCACHED_UNKNOWN_STAT_KEY;
+ /* return MEMCACHED_UNKNOWN_STAT_KEY; */
+ return MEMCACHED_SUCCESS;
}
return MEMCACHED_SUCCESS;
return NULL;
}
+ if (length >= SMALL_STRING_LEN || length < 0)
+ {
+ *error= MEMCACHED_FAILURE;
+ return NULL;
+ }
+
ret= libmemcached_malloc(ptr, (size_t) (length + 1));
memcpy(ret, buffer, (size_t) length);
ret[length]= '\0';
request.message.header.request.keylen= htons((uint16_t)len);
request.message.header.request.bodylen= htonl((uint32_t) len);
- struct __write_vector_st vector[]=
+ struct libmemcached_io_vector_st vector[]=
{
{ .length= sizeof(request.bytes), .buffer= request.bytes },
{ .length= len, .buffer= args }
- };
+ };
if (memcached_vdo(instance, vector, 2, true) != MEMCACHED_SUCCESS)
{
WATCHPOINT_ASSERT(0);
}
}
-
+
if (check && check->func)
{
size_t key_length= strlen(buffer);
{
memcached_return_t rc;
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
- size_t send_length;
+ int send_length;
if (args)
send_length= (size_t) snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
send_length= (size_t) snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
"stats\r\n");
- if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
+ if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || send_length < 0)
return MEMCACHED_WRITE_FAILURE;
- rc= memcached_do(instance, buffer, send_length, true);
+ rc= memcached_do(instance, buffer, (size_t)send_length, true);
if (rc != MEMCACHED_SUCCESS)
goto error;