summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libproto/pop/pop3_create.c2
-rw-r--r--libproto/pop/pop3_destroy.c1
-rw-r--r--libproto/pop/pop3_stream.c8
-rw-r--r--mailbox/fltstream.c9
4 files changed, 9 insertions, 11 deletions
diff --git a/libproto/pop/pop3_create.c b/libproto/pop/pop3_create.c
index eb6a6e82a..dc92360b5 100644
--- a/libproto/pop/pop3_create.c
+++ b/libproto/pop/pop3_create.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <mailutils/errno.h>
#include <mailutils/sys/pop3.h>
+#include <mailutils/list.h>
/* Initialise a mu_pop3_t handle. */
@@ -58,6 +59,7 @@ _mu_pop3_init (mu_pop3_t pop3)
mu_list_destroy (&pop3->capa);
pop3->flags = 0;
}
+ return 0;
}
diff --git a/libproto/pop/pop3_destroy.c b/libproto/pop/pop3_destroy.c
index 75ee7d777..010a06353 100644
--- a/libproto/pop/pop3_destroy.c
+++ b/libproto/pop/pop3_destroy.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <mailutils/errno.h>
#include <mailutils/sys/pop3.h>
+#include <mailutils/list.h>
void
mu_pop3_destroy (mu_pop3_t *ppop3)
diff --git a/libproto/pop/pop3_stream.c b/libproto/pop/pop3_stream.c
index ae4024aa3..bc0a76ff4 100644
--- a/libproto/pop/pop3_stream.c
+++ b/libproto/pop/pop3_stream.c
@@ -142,7 +142,8 @@ _pop3_decoder (void *xd,
}
else if (c == '.' && *pstate == pds_crlf)
{
- if (i + 1 == isize)
+ /* Make sure we have two more characters in the buffer */
+ if (i + 2 == isize)
break;
*pstate = newstate (*pstate, c);
if (*iptr != '\r')
@@ -154,7 +155,10 @@ _pop3_decoder (void *xd,
}
if (*pstate == pds_end)
- iobuf->eof = 1;
+ {
+ j -= 2; /* remove the trailing .\n */
+ iobuf->eof = 1;
+ }
iobuf->isize = i;
iobuf->osize = j;
return mu_filter_ok;
diff --git a/mailbox/fltstream.c b/mailbox/fltstream.c
index 3190c2c73..5af981a2e 100644
--- a/mailbox/fltstream.c
+++ b/mailbox/fltstream.c
@@ -159,15 +159,6 @@ filter_read (mu_stream_t stream, char *buf, size_t size, size_t *pret)
switch (res)
{
case mu_filter_ok:
- if (iobuf.isize == 0 || iobuf.osize == 0)
- {
- /* FIXME: Hack to handle eventual buggy filters */
- if (iobuf.isize == 0)
- min_input_level++;
- if (iobuf.osize == 0)
- min_output_size++;
- continue;
- }
if (iobuf.isize > MFB_RDBYTES (fs->inbuf)
|| iobuf.osize > MFB_FREESIZE (fs->outbuf))
return MU_ERR_FAILURE; /* FIXME: special error code? */

Return to:

Send suggestions and report system problems to the System administrator.