Commit 7585f48f 7585f48fd66e55f85fea516e1706a945db5e1149 by Sergey Poznyakoff

Bigfixes.

* imap4d/io.c (io_copy_out): Switch to full buffering before sending
data.
* libmailutils/stream/stream.c (_stream_skip_input_bytes): Bugfix.
1 parent c80cac74
......@@ -159,7 +159,26 @@ sc2string (int rc)
int
io_copy_out (mu_stream_t str, size_t size)
{
return mu_stream_copy (iostream, str, size, NULL);
int rc;
struct mu_buffer_query oldbuf, newbuf;
oldbuf.type = MU_TRANSPORT_OUTPUT;
if (mu_stream_ioctl (iostream, MU_IOCTL_TRANSPORT_BUFFER,
MU_IOCTL_OP_GET, &oldbuf) == 0)
{
newbuf.type = MU_TRANSPORT_OUTPUT;
newbuf.buftype = mu_buffer_full;
newbuf.bufsize = 64*1024;
mu_stream_ioctl (iostream, MU_IOCTL_TRANSPORT_BUFFER,
MU_IOCTL_OP_SET, &newbuf);
}
rc = mu_stream_copy (iostream, str, size, NULL);
mu_stream_ioctl (iostream, MU_IOCTL_TRANSPORT_BUFFER,
MU_IOCTL_OP_SET, &oldbuf);
return rc;
}
int
......
......@@ -520,7 +520,7 @@ _stream_skip_input_bytes (mu_stream_t stream, mu_off_t count, mu_off_t *pres)
{
for (pos = 0;;)
{
if (stream->pos == stream->level)
if (pos || stream->level == 0)
{
if ((rc = _stream_flush_buffer (stream, _MU_STR_FLUSH_ALL)))
return rc;
......