No, I didn't read carefully and thought you referred to the bug
where
the OS buffers are filled and long lines are truncated. I guess it
was fixed long time ago though. Either raising the buffer size so
that long lines aren't corrupted, or doing what you suggest seems like
a very good idea.
In case this is helpful to others before the next Cyrus release, I'm
cc'ing you guys for the record. The following patch was submitted to
and accepted by the Cyrus IMAPD maintainers.
--Jered
--- cyrus-imapd-2.1.3/imtest/imtest.c 2002/04/03 20:06:25 1.1
+++ cyrus-imapd-2.1.3/imtest/imtest.c 2002/04/03 20:22:18
@@ -1139,10 +1139,14 @@
FD_CLR(0, &read_set);
} else {
count = strlen(buf);
- buf[count - 1] = '\r';
- buf[count] = '\n';
- buf[count + 1] = '\0';
- prot_write(pout, buf, count + 1);
+ /* If we read a full line, translate the newline */
+ if (buf[count - 1] == '\n') {
+ buf[count - 1] = '\r';
+ buf[count] = '\n';
+ buf[count + 1] = '\0';
+ count++;
+ }
+ prot_write(pout, buf, count);
}
prot_flush(pout);
} else if (FD_ISSET(sock, &rset)) {