}
if (memcached_failed(rc= memcached_validate_key_length(key_length, ptr->flags.binary_protocol)))
+ {
return rc;
+ }
- 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)))
+ {
return MEMCACHED_BAD_KEY_PROVIDED;
+ }
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),
- memcached_print_array(ptr->prefix_key),
+ memcached_print_array(ptr->_namespace),
(int)key_length, key, flags,
(unsigned long long)expiration, (unsigned long)value_length,
(unsigned long long)cas,
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));
/* Copy in the key, adjust point if a key prefix was used. */
- buffer_ptr= (char *)memcpy(buffer_ptr + memcached_array_size(ptr->prefix_key),
+ buffer_ptr= (char *)memcpy(buffer_ptr + memcached_array_size(ptr->_namespace),
key, key_length);
buffer_ptr+= key_length;
buffer_ptr[0]= ' ';
request.message.header.request.magic= PROTOCOL_BINARY_REQ;
request.message.header.request.opcode= get_com_code(verb, noreply);
- request.message.header.request.keylen= htons((uint16_t)(key_length + memcached_array_size(ptr->prefix_key)));
+ request.message.header.request.keylen= htons((uint16_t)(key_length + memcached_array_size(ptr->_namespace)));
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.body.expiration= htonl((uint32_t)expiration);
}
- request.message.header.request.bodylen= htonl((uint32_t) (key_length + memcached_array_size(ptr->prefix_key) + value_length +
+ request.message.header.request.bodylen= htonl((uint32_t) (key_length + memcached_array_size(ptr->_namespace) + value_length +
request.message.header.request.extlen));
if (cas)
struct libmemcached_io_vector_st vector[]=
{
{ send_length, request.bytes },
- { memcached_array_size(ptr->prefix_key), memcached_array_string(ptr->prefix_key) },
+ { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
{ key_length, key },
{ value_length, value }
};