Commit cff44776 cff44776a11f31dcbaa0445fbddf02e7cd8284c0 by Sergey Poznyakoff

Pop3-client bugfixes (mostly).

* libmailutils/stream/fltstream.c (filter_ctl): MU_IOCTL_TRANSPORT
returns filter transport stream.
* libproto/pop/pop3_rdlist.c (mu_pop3_stream_to_list): Make sure
status is initialized and reflects the actual status.
* libproto/pop/pop3_stream.c (mu_pop3_filter_create): Do not unref
transport stream, it is done by the caller.
1 parent d78773a2
......@@ -407,8 +407,11 @@ filter_ctl (struct _mu_stream *stream, int code, int opcode, void *ptr)
ptrans[1] = NULL;
}
break;
default:
return ENOSYS;
}
/* fall through */
break;
default:
return mu_stream_ioctl (fs->transport, code, opcode, ptr);
}
......
......@@ -33,7 +33,8 @@ mu_pop3_stream_to_list (mu_pop3_t pop3, mu_stream_t stream, mu_list_t list)
int status;
size_t n;
while (mu_stream_getline (stream, &pop3->rdbuf, &pop3->rdsize, &n) == 0
while ((status = mu_stream_getline (stream, &pop3->rdbuf, &pop3->rdsize, &n))
== 0
&& n > 0)
{
char *np = strdup (pop3->rdbuf);
......
......@@ -74,7 +74,6 @@ mu_pop3_filter_create (mu_stream_t *pstream, mu_stream_t stream)
rc = mu_filter_create (pstream, stream, "CRLFDOT", MU_FILTER_DECODE,
MU_STREAM_READ);
mu_stream_unref (stream);
if (rc == 0)
{
struct mu_pop3_stream *sp = (struct mu_pop3_stream *) stream;
......