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) ...@@ -407,8 +407,11 @@ filter_ctl (struct _mu_stream *stream, int code, int opcode, void *ptr)
407 ptrans[1] = NULL; 407 ptrans[1] = NULL;
408 } 408 }
409 break; 409 break;
410 default:
411 return ENOSYS;
410 } 412 }
411 /* fall through */ 413 break;
414
412 default: 415 default:
413 return mu_stream_ioctl (fs->transport, code, opcode, ptr); 416 return mu_stream_ioctl (fs->transport, code, opcode, ptr);
414 } 417 }
......
...@@ -33,7 +33,8 @@ mu_pop3_stream_to_list (mu_pop3_t pop3, mu_stream_t stream, mu_list_t list) ...@@ -33,7 +33,8 @@ mu_pop3_stream_to_list (mu_pop3_t pop3, mu_stream_t stream, mu_list_t list)
33 int status; 33 int status;
34 size_t n; 34 size_t n;
35 35
36 while (mu_stream_getline (stream, &pop3->rdbuf, &pop3->rdsize, &n) == 0 36 while ((status = mu_stream_getline (stream, &pop3->rdbuf, &pop3->rdsize, &n))
37 == 0
37 && n > 0) 38 && n > 0)
38 { 39 {
39 char *np = strdup (pop3->rdbuf); 40 char *np = strdup (pop3->rdbuf);
......
...@@ -74,7 +74,6 @@ mu_pop3_filter_create (mu_stream_t *pstream, mu_stream_t stream) ...@@ -74,7 +74,6 @@ mu_pop3_filter_create (mu_stream_t *pstream, mu_stream_t stream)
74 74
75 rc = mu_filter_create (pstream, stream, "CRLFDOT", MU_FILTER_DECODE, 75 rc = mu_filter_create (pstream, stream, "CRLFDOT", MU_FILTER_DECODE,
76 MU_STREAM_READ); 76 MU_STREAM_READ);
77 mu_stream_unref (stream);
78 if (rc == 0) 77 if (rc == 0)
79 { 78 {
80 struct mu_pop3_stream *sp = (struct mu_pop3_stream *) stream; 79 struct mu_pop3_stream *sp = (struct mu_pop3_stream *) stream;
......