- if (ptr->flags.verify_key && (memcached_key_test((const char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
+ if (memcached_failed(memcached_key_test(*ptr, (const char **)&key, &key_length, 1)))
+ {
uint32_t server_key= memcached_generate_hash_with_redistribution(ptr, group_key, group_key_length);
memcached_server_write_instance_st instance= memcached_server_instance_fetch(ptr, server_key);
uint32_t server_key= memcached_generate_hash_with_redistribution(ptr, group_key, group_key_length);
memcached_server_write_instance_st instance= memcached_server_instance_fetch(ptr, server_key);
check_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
"%s %.*s%.*s %u %llu %lu %llu%s\r\n",
storage_op_string(verb),
check_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
"%s %.*s%.*s %u %llu %lu %llu%s\r\n",
storage_op_string(verb),
(int)key_length, key, flags,
(unsigned long long)expiration, (unsigned long)value_length,
(unsigned long long)cas,
(ptr->flags.no_reply) ? " noreply" : "");
if (check_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || check_length < 0)
{
(int)key_length, key, flags,
(unsigned long long)expiration, (unsigned long)value_length,
(unsigned long long)cas,
(ptr->flags.no_reply) ? " noreply" : "");
if (check_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || check_length < 0)
{
- rc= MEMCACHED_WRITE_FAILURE;
+ rc= memcached_set_error(*instance, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
+ memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
memcpy(buffer_ptr, command, strlen(command));
/* Copy in the key prefix, switch to the buffer_ptr */
memcpy(buffer_ptr, command, strlen(command));
/* Copy in the key prefix, switch to the buffer_ptr */
- buffer_ptr= (char *)memcpy((char *)(buffer_ptr + strlen(command)), (char *)memcached_array_string(ptr->prefix_key), memcached_array_size(ptr->prefix_key));
+ buffer_ptr= (char *)memcpy((char *)(buffer_ptr + strlen(command)), (char *)memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace));
ptr->flags.no_reply ? " noreply" : "");
if ((size_t)check_length >= MEMCACHED_DEFAULT_COMMAND_SIZE -size_t(buffer_ptr - buffer) || check_length < 0)
{
ptr->flags.no_reply ? " noreply" : "");
if ((size_t)check_length >= MEMCACHED_DEFAULT_COMMAND_SIZE -size_t(buffer_ptr - buffer) || check_length < 0)
{
- rc= MEMCACHED_WRITE_FAILURE;
+ rc= memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
+ memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)"));
request.message.header.request.magic= PROTOCOL_BINARY_REQ;
request.message.header.request.opcode= get_com_code(verb, noreply);
request.message.header.request.magic= PROTOCOL_BINARY_REQ;
request.message.header.request.opcode= get_com_code(verb, noreply);
request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
if (verb == APPEND_OP || verb == PREPEND_OP)
send_length -= 8; /* append & prepend does not contain extras! */
request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
if (verb == APPEND_OP || verb == PREPEND_OP)
send_length -= 8; /* append & prepend does not contain extras! */
struct libmemcached_io_vector_st vector[]=
{
{ send_length, request.bytes },
struct libmemcached_io_vector_st vector[]=
{
{ send_length, request.bytes },