for (x= 0; x < ptr->number_of_hosts; x++)
{
- if (ptr->hosts[x].cursor_active &&
+ if (memcached_server_response_count(ptr, x) &&
ptr->hosts[x].read_data_length < MEMCACHED_MAX_BUFFER )
{
size_t data_read;
while (length)
{
+ uint8_t found_eof= 0;
if (!ptr->hosts[server_key].read_buffer_length)
{
size_t data_read;
}
else if (data_read)
break;
- /* If zero, just keep looping */
+ /* If zero, just keep looping unless testing, then assert() */
+ else
+ {
+ WATCHPOINT_ASSERT(0);
+ found_eof= 1;
+ break;
+ }
}
ptr->hosts[server_key].read_data_length= data_read;
ptr->hosts[server_key].read_buffer_length--;
buffer_ptr++;
}
+
+ if (found_eof)
+ break;
}
return (size_t)(buffer_ptr - buffer);