Davae patch to reconnect when POP timeout.
Showing
1 changed file
with
8 additions
and
1 deletions
... | @@ -240,6 +240,8 @@ do \ | ... | @@ -240,6 +240,8 @@ do \ |
240 | { \ | 240 | { \ |
241 | stream_close (mbox->stream); \ | 241 | stream_close (mbox->stream); \ |
242 | CLEAR_STATE (mpd); \ | 242 | CLEAR_STATE (mpd); \ |
243 | mpd->func = (void *)-1; \ | ||
244 | MAILBOX_DEBUG1(mbox, MU_DEBUG_PROT, "CHECK_ERROR_CLOSE: %s\n", strerror (status));\ | ||
243 | return status; \ | 245 | return status; \ |
244 | } \ | 246 | } \ |
245 | } \ | 247 | } \ |
... | @@ -252,6 +254,8 @@ do \ | ... | @@ -252,6 +254,8 @@ do \ |
252 | if (status != 0) \ | 254 | if (status != 0) \ |
253 | { \ | 255 | { \ |
254 | CLEAR_STATE (mpd); \ | 256 | CLEAR_STATE (mpd); \ |
257 | mpd->func = (void*)-1; \ | ||
258 | MAILBOX_DEBUG1(mpd->mbox, MU_DEBUG_PROT, "CHECK_ERROR: %s\n", strerror (status));\ | ||
255 | return status; \ | 259 | return status; \ |
256 | } \ | 260 | } \ |
257 | } \ | 261 | } \ |
... | @@ -266,6 +270,8 @@ do \ | ... | @@ -266,6 +270,8 @@ do \ |
266 | if (status != EAGAIN && status != EINPROGRESS && status != EINTR) \ | 270 | if (status != EAGAIN && status != EINPROGRESS && status != EINTR) \ |
267 | { \ | 271 | { \ |
268 | CLEAR_STATE (mpd); \ | 272 | CLEAR_STATE (mpd); \ |
273 | mpd->func = (void *)-1; \ | ||
274 | MAILBOX_DEBUG1(mpd->mbox, MU_DEBUG_PROT, "CHECK_EAGAIN: %s\n", strerror (status));\ | ||
269 | } \ | 275 | } \ |
270 | return status; \ | 276 | return status; \ |
271 | } \ | 277 | } \ |
... | @@ -1610,6 +1616,8 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset, | ... | @@ -1610,6 +1616,8 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset, |
1610 | /* RETR ACK. */ | 1616 | /* RETR ACK. */ |
1611 | status = pop_read_ack (mpd); | 1617 | status = pop_read_ack (mpd); |
1612 | CHECK_EAGAIN (mpd, status); | 1618 | CHECK_EAGAIN (mpd, status); |
1619 | MAILBOX_DEBUG0 (mpd->mbox, MU_DEBUG_PROT, mpd->buffer); | ||
1620 | |||
1613 | if (strncasecmp (mpd->buffer, "+OK", 3) != 0) | 1621 | if (strncasecmp (mpd->buffer, "+OK", 3) != 0) |
1614 | { | 1622 | { |
1615 | CHECK_ERROR (mpd, EACCES); | 1623 | CHECK_ERROR (mpd, EACCES); |
... | @@ -1622,7 +1630,6 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset, | ... | @@ -1622,7 +1630,6 @@ pop_retr (pop_message_t mpm, char *buffer, size_t buflen, off_t offset, |
1622 | { | 1630 | { |
1623 | /* Do we need to fill up. */ | 1631 | /* Do we need to fill up. */ |
1624 | if (mpd->nl == NULL || mpd->ptr == mpd->buffer) | 1632 | if (mpd->nl == NULL || mpd->ptr == mpd->buffer) |
1625 | |||
1626 | { | 1633 | { |
1627 | status = pop_readline (mpd); | 1634 | status = pop_readline (mpd); |
1628 | if (status != 0) | 1635 | if (status != 0) | ... | ... |
-
Please register or sign in to post a comment