{
if (io_death == 0 && ptr->type != MEMCACHED_CONNECTION_UDP)
{
- memcached_return rc;
+ memcached_return_t rc;
char buffer[MEMCACHED_MAX_BUFFER];
- if (ptr->root->flags & MEM_BINARY_PROTOCOL)
+ if (ptr->root->flags.binary_protocol)
{
protocol_binary_request_quit request = {.bytes= {0}};
request.message.header.request.magic = PROTOCOL_BINARY_REQ;
ssize_t nread;
while (memcached_io_read(ptr, buffer, sizeof(buffer)/sizeof(*buffer),
&nread) == MEMCACHED_SUCCESS);
+
+ /*
+ * memcached_io_read may call memcached_quit_server with io_death if
+ * it encounters problems, but we don't care about those occurences.
+ * The intention of that loop is to drain the data sent from the
+ * server to ensure that the server processed all of the data we
+ * sent to the server.
+ */
+ ptr->server_failure_counter= 0;
}
memcached_io_close(ptr);