We must not report incomplete data if the buffer is not full, otherwise
we can abort some processing on the stats socket when dealing with massive
amounts of commands.
break;
p = buffer_wrap_add(chn->buf, p + 1);
}
- if (ret > 0 && ret < len && ret < chn->buf->o &&
+ if (ret > 0 && ret < len &&
+ (ret < chn->buf->o || !channel_full(chn)) &&
*(str-1) != '\n' &&
!(chn->flags & (CF_SHUTW|CF_SHUTW_NOW)))
ret = 0;