struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length, key }
+ { request.bytes, sizeof(request.bytes) },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { key, key_length }
};
memcached_return_t rc;
}
if (no_reply)
+ {
return MEMCACHED_SUCCESS;
+ }
return memcached_response(instance, (char*)value, sizeof(*value), NULL);
}
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes},
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length, key },
+ { request.bytes, sizeof(request.bytes) },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { key, key_length }
};
memcached_return_t rc= MEMCACHED_SUCCESS;
{
struct libmemcached_io_vector_st vector[]=
{
- { sizeof("add ") -1, "add " },
- { memcached_array_size(memc->_namespace), memcached_array_string(memc->_namespace) },
- { key_length, key },
- { sizeof(" 0") -1, " 0" },
- { sizeof(" 2678400") -1, " 2678400" },
- { sizeof(" 0") -1, " 0" },
- { 2, "\r\n" },
- { 2, "\r\n" }
+ { memcached_literal_param("add ") },
+ { memcached_array_string(memc->_namespace), memcached_array_size(memc->_namespace) },
+ { key, key_length },
+ { memcached_literal_param(" 0") },
+ { memcached_literal_param(" 2678400") },
+ { memcached_literal_param(" 0") },
+ { memcached_literal_param("\r\n") },
+ { memcached_literal_param("\r\n") }
};
/* Send command header */
struct libmemcached_io_vector_st vector[]=
{
- { send_length, request.bytes },
- { memcached_array_size(memc->_namespace), memcached_array_string(memc->_namespace) },
- { key_length, key }
+ { request.bytes, send_length },
+ { memcached_array_string(memc->_namespace), memcached_array_size(memc->_namespace) },
+ { key, key_length }
};
/* write the header */
struct libmemcached_io_vector_st vector[]=
{
- { get_command_length, get_command },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length[x], keys[x] },
- { 1, " " }
+ { get_command, get_command_length },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { keys[x], key_length[x] },
+ { memcached_literal_param(" ") }
};
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length[x], keys[x] }
+ { request.bytes, sizeof(request.bytes) },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { keys[x], key_length[x] }
};
if (memcached_io_writev(instance, vector, 3, flush) == -1)
*/
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length[x], keys[x] }
+ { request.bytes, sizeof(request.bytes) },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { keys[x], key_length[x] }
};
if (memcached_io_writev(instance, vector, 3, true) == -1)
}
if (success)
+ {
break;
+ }
}
return rc;
static ssize_t _io_write(memcached_server_write_instance_st ptr,
const void *buffer, size_t length, bool with_flush)
{
- size_t original_length;
- const char* buffer_ptr;
-
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
- original_length= length;
- buffer_ptr= static_cast<const char *>(buffer);
+ size_t original_length= length;
+ const char *buffer_ptr= static_cast<const char *>(buffer);
while (length)
{
struct libmemcached_io_vector_st
{
- size_t length;
const void *buffer;
+ size_t length;
};
#ifdef __cplusplus
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { keylen, chosenmech },
- { len, data }
+ { request.bytes, sizeof(request.bytes) },
+ { chosenmech, keylen },
+ { data, len }
};
if (memcached_io_writev(server, vector, 3, true) == -1)
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { len, args }
+ { request.bytes, sizeof(request.bytes) },
+ { args, len }
};
if (memcached_vdo(instance, vector, 2, true) != MEMCACHED_SUCCESS)
struct libmemcached_io_vector_st vector[]=
{
- { send_length, request.bytes },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length, key },
- { value_length, value }
+ { request.bytes, send_length },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { key, key_length },
+ { value, value_length }
};
/* write the header */
{
struct libmemcached_io_vector_st vector[]=
{
- { write_length, buffer },
- { value_length, value },
- { 2, "\r\n" }
+ { buffer, write_length },
+ { value, value_length },
+ { memcached_literal_param("\r\n") }
};
if (ptr->flags.buffer_requests && verb == SET_OP)