#include <libmemcached/common.h>
-memcached_return_t memcached_do(memcached_server_write_instance_st ptr,
- const void *command,
- const size_t command_length,
- const bool with_flush)
-{
- assert_msg(command_length, "Programming error, somehow a command had a length of zero");
- assert_msg(command, "Programming error, somehow a command was NULL");
-
- libmemcached_io_vector_st vector[1]= { { command, command_length } };
-
- return memcached_vdo(ptr, vector, 1, with_flush);
-}
-
memcached_return_t memcached_vdo(memcached_server_write_instance_st ptr,
const struct libmemcached_io_vector_st *vector,
const size_t count,
static inline memcached_return_t memcached_version_textual(memcached_st *ptr)
{
+ struct libmemcached_io_vector_st vector[]=
+ {
+ { memcached_literal_param("version\r\n") },
+ };
memcached_return_t rc= MEMCACHED_SUCCESS;
+
for (uint32_t x= 0; x < memcached_server_count(ptr); x++)
{
memcached_server_write_instance_st instance= memcached_server_instance_fetch(ptr, x);
continue;
}
- memcached_return_t rrc= memcached_do(instance, memcached_literal_param("version\r\n"), true);
+ memcached_return_t rrc= memcached_vdo(instance, vector, 1, true);
if (memcached_failed(rrc))
{
(void)memcached_set_error(*instance, rrc, MEMCACHED_AT);
}
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
- rrc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
+ rrc= memcached_response(instance, buffer, sizeof(buffer), NULL);
if (memcached_failed(rrc))
{
memcached_set_error(*instance, rrc, MEMCACHED_AT);
request.message.header.request.opcode= PROTOCOL_BINARY_CMD_VERSION;
request.message.header.request.datatype= PROTOCOL_BINARY_RAW_BYTES;
+ struct libmemcached_io_vector_st vector[]=
+ {
+ { request.bytes, sizeof(request.bytes) }
+ };
+
memcached_return_t rc= MEMCACHED_SUCCESS;
for (uint32_t x= 0; x < memcached_server_count(ptr); x++)
{
continue;
}
- memcached_return_t rrc= memcached_do(instance, request.bytes, sizeof(request.bytes), true);
+ memcached_return_t rrc= memcached_vdo(instance, vector, 1, true);
if (memcached_failed(rrc))
{
memcached_io_reset(instance);
for (uint32_t x= 0; x < memcached_server_count(ptr); x++)
{
- memcached_server_write_instance_st instance=
- memcached_server_instance_fetch(ptr, x);
+ memcached_server_write_instance_st instance= memcached_server_instance_fetch(ptr, x);
if (instance->major_version != UINT8_MAX)
{