if ((memcached_do(instance, request.bytes,
sizeof(request.bytes), 0)!=MEMCACHED_SUCCESS) ||
- (memcached_io_write(instance, key, key_length, 1) == -1))
+ (memcached_io_write(instance, key, key_length, true) == -1))
{
memcached_io_reset(instance);
return MEMCACHED_WRITE_FAILURE;
if (send_length > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)
return MEMCACHED_WRITE_FAILURE;
if (send_length + instance->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
- memcached_io_write(instance, NULL, 0, 1);
+ memcached_io_write(instance, NULL, 0, true);
}
rc= memcached_do(instance, buffer, send_length, to_write);
if (cmd_size > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)
return MEMCACHED_WRITE_FAILURE;
if (cmd_size + instance->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
- memcached_io_write(instance, NULL, 0, 1);
+ memcached_io_write(instance, NULL, 0, true);
}
memcached_return_t rc= MEMCACHED_SUCCESS;
if ((memcached_do(instance, request.bytes,
sizeof(request.bytes), 0) != MEMCACHED_SUCCESS) ||
(memcached_io_write(instance, key,
- key_length, (char) flush) == -1))
+ key_length, (bool) flush) == -1))
{
memcached_io_reset(instance);
rc= MEMCACHED_WRITE_FAILURE;
if ((memcached_do(replica, (const char*)request.bytes,
sizeof(request.bytes), 0) != MEMCACHED_SUCCESS) ||
- (memcached_io_write(replica, key, key_length, (char) flush) == -1))
+ (memcached_io_write(replica, key, key_length, (bool) flush) == -1))
{
memcached_io_reset(replica);
}
** otherwise we might get a partial write.
**/
if (ptr->type == MEMCACHED_CONNECTION_UDP && with_flush && ptr->write_buffer_offset > UDP_DATAGRAM_HEADER_LENGTH)
- memcached_io_write(ptr, NULL, 0, 1);
+ memcached_io_write(ptr, NULL, 0, true);
- sent_length= memcached_io_write(ptr, command, command_length, (char) with_flush);
+ sent_length= memcached_io_write(ptr, command, command_length, (bool) with_flush);
if (sent_length == -1 || (size_t)sent_length != command_length)
rc= MEMCACHED_WRITE_FAILURE;
WATCHPOINT_ERROR(ret);
return ret;
}
- if (memcached_io_write(instance, NULL, 0, 1) == -1)
+ if (memcached_io_write(instance, NULL, 0, true) == -1)
ret= MEMCACHED_SOME_ERRORS;
}
}
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
if (ptr->flags.no_block)
- (void)memcached_io_write(instance, NULL, 0, 1);
+ (void)memcached_io_write(instance, NULL, 0, true);
while(memcached_server_response_count(instance))
(void)memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, &ptr->result);
if (rc != MEMCACHED_SUCCESS)
continue;
- if ((memcached_io_write(instance, get_command, get_command_length, 0)) == -1)
+ if ((memcached_io_write(instance, get_command, get_command_length, false)) == -1)
{
rc= MEMCACHED_SOME_ERRORS;
continue;
/* Only called when we have a prefix key */
if (ptr->prefix_key_length)
{
- if ((memcached_io_write(instance, ptr->prefix_key, ptr->prefix_key_length, 0)) == -1)
+ if ((memcached_io_write(instance, ptr->prefix_key, ptr->prefix_key_length, false)) == -1)
{
memcached_server_response_reset(instance);
rc= MEMCACHED_SOME_ERRORS;
}
}
- if ((memcached_io_write(instance, keys[x], key_length[x], 0)) == -1)
+ if ((memcached_io_write(instance, keys[x], key_length[x], false)) == -1)
{
memcached_server_response_reset(instance);
rc= MEMCACHED_SOME_ERRORS;
continue;
}
- if ((memcached_io_write(instance, " ", 1, 0)) == -1)
+ if ((memcached_io_write(instance, " ", 1, false)) == -1)
{
memcached_server_response_reset(instance);
rc= MEMCACHED_SOME_ERRORS;
if (memcached_server_response_count(instance))
{
/* We need to do something about non-connnected hosts in the future */
- if ((memcached_io_write(instance, "\r\n", 2, 1)) == -1)
+ if ((memcached_io_write(instance, "\r\n", 2, true)) == -1)
{
rc= MEMCACHED_SOME_ERRORS;
}
request.message.header.request.bodylen= htonl((uint32_t) key_length[x]);
if ((memcached_io_write(instance, request.bytes,
- sizeof(request.bytes), 0) == -1) ||
+ sizeof(request.bytes), false) == -1) ||
(memcached_io_write(instance, keys[x],
key_length[x], (char) flush) == -1))
{
if (memcached_server_response_count(instance))
{
- if (memcached_io_write(instance, NULL, 0, 1) == -1)
+ if (memcached_io_write(instance, NULL, 0, true) == -1)
{
memcached_server_response_reset(instance);
memcached_io_reset(instance);
}
if (memcached_io_write(instance, request.bytes,
- sizeof(request.bytes), 1) == -1)
+ sizeof(request.bytes), true) == -1)
{
memcached_server_response_reset(instance);
memcached_io_reset(instance);
* just make sure we work _correctly_
*/
if ((memcached_io_write(instance, request.bytes,
- sizeof(request.bytes), 0) == -1) ||
+ sizeof(request.bytes), false) == -1) ||
(memcached_io_write(instance, keys[x],
- key_length[x], 1) == -1))
+ key_length[x], true) == -1))
{
memcached_io_reset(instance);
dead_servers[server]= true;
}
ssize_t memcached_io_write(memcached_server_instance_st *ptr,
- const void *buffer, size_t length, char with_flush)
+ const void *buffer, size_t length, bool with_flush)
{
size_t original_length;
const char* buffer_ptr;
LIBMEMCACHED_LOCAL
ssize_t memcached_io_write(memcached_server_instance_st *ptr,
- const void *buffer, size_t length, char with_flush);
+ const void *buffer, size_t length, bool with_flush);
LIBMEMCACHED_LOCAL
void memcached_io_reset(memcached_server_instance_st *ptr);
WATCHPOINT_ASSERT(ptr->fd != -1);
/* Force a flush of the buffer to ensure that we don't have the n-1 pending
requests buffered up.. */
- if (memcached_io_write(ptr, NULL, 0, 1) == -1)
+ if (memcached_io_write(ptr, NULL, 0, true) == -1)
{
memcached_set_purging(root, true);
/* We may have old commands in the buffer not set, first purge */
if ((ptr->root->flags.no_block) && (memcached_is_processing_input(ptr->root) == false))
{
- (void)memcached_io_write(ptr, NULL, 0, 1);
+ (void)memcached_io_write(ptr, NULL, 0, true);
}
/*
if ((memcached_do(instance, request.bytes,
sizeof(request.bytes), 0) != MEMCACHED_SUCCESS) ||
- (memcached_io_write(instance, args, len, 1) == -1))
+ (memcached_io_write(instance, args, len, true) == -1))
{
memcached_io_reset(instance);
return MEMCACHED_WRITE_FAILURE;
if (cmd_size > MAX_UDP_DATAGRAM_LENGTH - UDP_DATAGRAM_HEADER_LENGTH)
return MEMCACHED_WRITE_FAILURE;
if (cmd_size + instance->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
- memcached_io_write(instance, NULL, 0, 1);
+ memcached_io_write(instance, NULL, 0, true);
}
if (write_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
goto error;
/* Send command body */
- if (memcached_io_write(instance, value, value_length, 0) == -1)
+ if (memcached_io_write(instance, value, value_length, false) == -1)
{
rc= MEMCACHED_WRITE_FAILURE;
goto error;
}
if (cmd_size + server->write_buffer_offset > MAX_UDP_DATAGRAM_LENGTH)
{
- memcached_io_write(server, NULL, 0, 1);
+ memcached_io_write(server, NULL, 0, true);
}
}
/* write the header */
if ((memcached_do(server, (const char*)request.bytes, send_length, 0) != MEMCACHED_SUCCESS) ||
- (memcached_io_write(server, key, key_length, 0) == -1) ||
+ (memcached_io_write(server, key, key_length, false) == -1) ||
(memcached_io_write(server, value, value_length, (char) flush) == -1))
{
memcached_io_reset(server);
if ((memcached_do(instance, (const char*)request.bytes,
send_length, 0) != MEMCACHED_SUCCESS) ||
- (memcached_io_write(instance, key, key_length, 0) == -1) ||
+ (memcached_io_write(instance, key, key_length, false) == -1) ||
(memcached_io_write(instance, value, value_length, (char) flush) == -1))
{
memcached_io_reset(instance);