Commit 02805296 028052962d14a2001901bcfc7b30852baa108d4d by Alain Magloire

.

1 parent 67d96f51
...@@ -75,7 +75,7 @@ mu_pop3_capa (mu_pop3_t pop3, list_t *plist) ...@@ -75,7 +75,7 @@ mu_pop3_capa (mu_pop3_t pop3, list_t *plist)
75 { 75 {
76 MU_POP3_CHECK_ERROR(pop3, ENOMEM); 76 MU_POP3_CHECK_ERROR(pop3, ENOMEM);
77 } 77 }
78 while ((status = mu_pop3_readline (pop3, capability, 512, &n)) > 0 && n > 0) 78 while ((status = mu_pop3_readline (pop3, capability, 512, &n)) == 0 && n > 0)
79 { 79 {
80 /* Nuke the trailing newline */ 80 /* Nuke the trailing newline */
81 if (capability[n - 1] == '\n') 81 if (capability[n - 1] == '\n')
......
...@@ -40,7 +40,7 @@ mu_pop3_connect (mu_pop3_t pop3) ...@@ -40,7 +40,7 @@ mu_pop3_connect (mu_pop3_t pop3)
40 return EINVAL; 40 return EINVAL;
41 41
42 /* A networking stack. */ 42 /* A networking stack. */
43 if (pop3->carrier) 43 if (pop3->carrier == NULL)
44 return EINVAL; 44 return EINVAL;
45 45
46 /* Enter the pop state machine, and boogy: AUTHORISATION State. */ 46 /* Enter the pop state machine, and boogy: AUTHORISATION State. */
......
...@@ -50,7 +50,7 @@ mu_pop3_list_all (mu_pop3_t pop3, list_t *plist) ...@@ -50,7 +50,7 @@ mu_pop3_list_all (mu_pop3_t pop3, list_t *plist)
50 case MU_POP3_LIST_ACK: 50 case MU_POP3_LIST_ACK:
51 status = mu_pop3_response (pop3, NULL, 0, NULL); 51 status = mu_pop3_response (pop3, NULL, 0, NULL);
52 MU_POP3_CHECK_EAGAIN (pop3, status); 52 MU_POP3_CHECK_EAGAIN (pop3, status);
53 mu_pop3_debug_cmd (pop3); 53 mu_pop3_debug_ack (pop3);
54 MU_POP3_CHECK_OK (pop3); 54 MU_POP3_CHECK_OK (pop3);
55 status = list_create (plist); 55 status = list_create (plist);
56 MU_POP3_CHECK_ERROR(pop3, status); 56 MU_POP3_CHECK_ERROR(pop3, status);
...@@ -69,7 +69,7 @@ mu_pop3_list_all (mu_pop3_t pop3, list_t *plist) ...@@ -69,7 +69,7 @@ mu_pop3_list_all (mu_pop3_t pop3, list_t *plist)
69 { 69 {
70 MU_POP3_CHECK_ERROR(pop3, ENOMEM); 70 MU_POP3_CHECK_ERROR(pop3, ENOMEM);
71 } 71 }
72 while ((status = mu_pop3_readline (pop3, lista, 512, &n)) > 0 && n > 0) 72 while ((status = mu_pop3_readline (pop3, lista, 512, &n)) == 0 && n > 0)
73 { 73 {
74 /* Nuke the trailing newline */ 74 /* Nuke the trailing newline */
75 if (lista[n - 1] == '\n') 75 if (lista[n - 1] == '\n')
......
...@@ -51,6 +51,9 @@ mu_pop3_uidl_all (mu_pop3_t pop3, list_t *plist) ...@@ -51,6 +51,9 @@ mu_pop3_uidl_all (mu_pop3_t pop3, list_t *plist)
51 MU_POP3_CHECK_EAGAIN (pop3, status); 51 MU_POP3_CHECK_EAGAIN (pop3, status);
52 mu_pop3_debug_ack (pop3); 52 mu_pop3_debug_ack (pop3);
53 MU_POP3_CHECK_OK (pop3); 53 MU_POP3_CHECK_OK (pop3);
54 status = list_create (plist);
55 MU_POP3_CHECK_ERROR(pop3, status);
56 list_set_destroy_item(*plist, free);
54 pop3->state = MU_POP3_UIDL_RX; 57 pop3->state = MU_POP3_UIDL_RX;
55 58
56 case MU_POP3_UIDL_RX: 59 case MU_POP3_UIDL_RX:
...@@ -65,7 +68,7 @@ mu_pop3_uidl_all (mu_pop3_t pop3, list_t *plist) ...@@ -65,7 +68,7 @@ mu_pop3_uidl_all (mu_pop3_t pop3, list_t *plist)
65 { 68 {
66 MU_POP3_CHECK_ERROR(pop3, ENOMEM); 69 MU_POP3_CHECK_ERROR(pop3, ENOMEM);
67 } 70 }
68 while ((status = mu_pop3_readline (pop3, uidla, 512, &n)) > 0 && n > 0) 71 while ((status = mu_pop3_readline (pop3, uidla, 512, &n)) == 0 && n > 0)
69 { 72 {
70 /* Nuke the trailing newline */ 73 /* Nuke the trailing newline */
71 if (uidla[n - 1] == '\n') 74 if (uidla[n - 1] == '\n')
......