If the output was less than IO_BLOCK_SIZE (as it usually would be), the code
just skipped over the whole buffered output and was confused that it didn't
find LF. Fixed by skipping over all but the last byte in the buffer, which
should be the LF.
Fixes:
Panic: file replicator-connection.c: line 99 (replicator_send_buf): assertion failed: (len < buf->used)
/* try to send about IO_BLOCK_SIZE amount of data,
but only full lines */
- if (len > buf->used)
- len = buf->used;
+ if (len >= buf->used)
+ len = buf->used - 1;
for (;; len++) {
i_assert(len < buf->used); /* there is always LF */
if (data[len] == '\n') {