diff options
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-engine.c | 23 |
2 files changed, 29 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 657dcbe72c..3f01cd49c7 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2004-07-22 Not Zed <NotZed@Ximian.com> + + ** See bug #61761. + + * providers/pop3/camel-pop3-engine.c (camel_pop3_engine_iterate): + if we get an io error, move every current/active and queued + command to the done queue and mark as failed. + 2004-07-19 Jeffrey Stedfast <fejj@novell.com> * providers/imap/camel-imap-store.c (get_subscribed_folders): Free diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c index 391d5bd31b..9c3f8423e9 100644 --- a/camel/providers/pop3/camel-pop3-engine.c +++ b/camel/providers/pop3/camel-pop3-engine.c @@ -293,7 +293,7 @@ camel_pop3_engine_iterate(CamelPOP3Engine *pe, CamelPOP3Command *pcwait) /* LOCK */ if (camel_pop3_stream_line(pe->stream, &pe->line, &pe->linelen) == -1) - return -1; + goto ioerror; p = pe->line; switch (p[0]) { @@ -339,7 +339,7 @@ camel_pop3_engine_iterate(CamelPOP3Engine *pe, CamelPOP3Command *pcwait) break; if (camel_stream_write((CamelStream *)pe->stream, pw->data, strlen(pw->data)) == -1) - return -1; + goto ioerror; e_dlist_remove((EDListNode *)pw); @@ -361,6 +361,25 @@ camel_pop3_engine_iterate(CamelPOP3Engine *pe, CamelPOP3Command *pcwait) return 0; return pe->current==NULL?0:1; +ioerror: + /* we assume all outstanding commands are gunna fail now */ + while ( (pw = (CamelPOP3Command*)e_dlist_remhead(&pe->active)) ) { + pw->state = CAMEL_POP3_COMMAND_ERR; + e_dlist_addtail(&pe->done, (EDListNode *)pw); + } + + while ( (pw = (CamelPOP3Command*)e_dlist_remhead(&pe->queue)) ) { + pw->state = CAMEL_POP3_COMMAND_ERR; + e_dlist_addtail(&pe->done, (EDListNode *)pw); + } + + if (pe->current) { + pe->current->state = CAMEL_POP3_COMMAND_ERR; + e_dlist_addtail(&pe->done, (EDListNode *)pe->current); + pe->current = NULL; + } + + return -1; } CamelPOP3Command * |