Commit 02805296 028052962d14a2001901bcfc7b30852baa108d4d by Alain Magloire

.

1 parent 67d96f51
......@@ -75,7 +75,7 @@ mu_pop3_capa (mu_pop3_t pop3, list_t *plist)
{
MU_POP3_CHECK_ERROR(pop3, ENOMEM);
}
while ((status = mu_pop3_readline (pop3, capability, 512, &n)) > 0 && n > 0)
while ((status = mu_pop3_readline (pop3, capability, 512, &n)) == 0 && n > 0)
{
/* Nuke the trailing newline */
if (capability[n - 1] == '\n')
......
......@@ -40,7 +40,7 @@ mu_pop3_connect (mu_pop3_t pop3)
return EINVAL;
/* A networking stack. */
if (pop3->carrier)
if (pop3->carrier == NULL)
return EINVAL;
/* Enter the pop state machine, and boogy: AUTHORISATION State. */
......
......@@ -50,7 +50,7 @@ mu_pop3_list_all (mu_pop3_t pop3, list_t *plist)
case MU_POP3_LIST_ACK:
status = mu_pop3_response (pop3, NULL, 0, NULL);
MU_POP3_CHECK_EAGAIN (pop3, status);
mu_pop3_debug_cmd (pop3);
mu_pop3_debug_ack (pop3);
MU_POP3_CHECK_OK (pop3);
status = list_create (plist);
MU_POP3_CHECK_ERROR(pop3, status);
......@@ -69,7 +69,7 @@ mu_pop3_list_all (mu_pop3_t pop3, list_t *plist)
{
MU_POP3_CHECK_ERROR(pop3, ENOMEM);
}
while ((status = mu_pop3_readline (pop3, lista, 512, &n)) > 0 && n > 0)
while ((status = mu_pop3_readline (pop3, lista, 512, &n)) == 0 && n > 0)
{
/* Nuke the trailing newline */
if (lista[n - 1] == '\n')
......
......@@ -51,6 +51,9 @@ mu_pop3_uidl_all (mu_pop3_t pop3, list_t *plist)
MU_POP3_CHECK_EAGAIN (pop3, status);
mu_pop3_debug_ack (pop3);
MU_POP3_CHECK_OK (pop3);
status = list_create (plist);
MU_POP3_CHECK_ERROR(pop3, status);
list_set_destroy_item(*plist, free);
pop3->state = MU_POP3_UIDL_RX;
case MU_POP3_UIDL_RX:
......@@ -65,7 +68,7 @@ mu_pop3_uidl_all (mu_pop3_t pop3, list_t *plist)
{
MU_POP3_CHECK_ERROR(pop3, ENOMEM);
}
while ((status = mu_pop3_readline (pop3, uidla, 512, &n)) > 0 && n > 0)
while ((status = mu_pop3_readline (pop3, uidla, 512, &n)) == 0 && n > 0)
{
/* Nuke the trailing newline */
if (uidla[n - 1] == '\n')
......