memcached_result_st *result)
{
/* We may have old commands in the buffer not set, first purge */
- if (ptr->root->flags & MEM_NO_BLOCK)
+ if ((ptr->root->flags & MEM_NO_BLOCK) && (!ptr->root->processing_input))
(void)memcached_io_write(ptr, NULL, 0, 1);
/*
{
switch (header.response.opcode)
{
- case PROTOCOL_BINARY_CMD_GETK:
case PROTOCOL_BINARY_CMD_GETKQ:
+ /*
+ * We didn't increment the response counter for the GETKQ packet
+ * (only the final NOOP), so we need to increment the counter again.
+ */
+ memcached_server_response_increment(ptr);
+ /* FALLTHROUGH */
+ case PROTOCOL_BINARY_CMD_GETK:
{
uint16_t keylen= header.response.keylen;
memcached_result_reset(result);