{
if (ptr->fd != -1)
{
- if (io_death == false && ptr->type != MEMCACHED_CONNECTION_UDP)
+ if (io_death == false && ptr->type != MEMCACHED_CONNECTION_UDP && ptr->options.is_shutting_down == false)
{
memcached_return_t rc;
char buffer[MEMCACHED_MAX_BUFFER];
+ ptr->options.is_shutting_down= true;
+
if (ptr->root->flags.binary_protocol)
{
protocol_binary_request_quit request = {.bytes= {0}};
ptr->write_buffer_offset= (size_t) ((ptr->type == MEMCACHED_CONNECTION_UDP) ? UDP_DATAGRAM_HEADER_LENGTH : 0);
ptr->read_buffer_length= 0;
ptr->read_ptr= ptr->read_buffer;
+ ptr->options.is_shutting_down= false;
memcached_server_response_reset(ptr);
if (io_death)
{
for (x= 0; x < memcached_server_count(ptr); x++)
{
- memcached_server_instance_st *instance=
+ memcached_server_write_instance_st instance=
memcached_server_instance_fetch(ptr, x);
- memcached_quit_server(instance, 0);
+ memcached_quit_server(instance, false);
}
}
}