diff options
author | Not Zed <NotZed@Ximian.com> | 2004-07-23 11:37:33 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-07-23 11:37:33 +0800 |
commit | b06ecefc61581d7048df8b9bcd06896b75a459d0 (patch) | |
tree | 2b3f725d050b40f2fb4749d13fe226ec0e395c2e | |
parent | 6f8d7b104d71b059d10f42ff99a3071157bdb6a6 (diff) | |
download | gsoc2013-evolution-b06ecefc61581d7048df8b9bcd06896b75a459d0.tar gsoc2013-evolution-b06ecefc61581d7048df8b9bcd06896b75a459d0.tar.gz gsoc2013-evolution-b06ecefc61581d7048df8b9bcd06896b75a459d0.tar.bz2 gsoc2013-evolution-b06ecefc61581d7048df8b9bcd06896b75a459d0.tar.lz gsoc2013-evolution-b06ecefc61581d7048df8b9bcd06896b75a459d0.tar.xz gsoc2013-evolution-b06ecefc61581d7048df8b9bcd06896b75a459d0.tar.zst gsoc2013-evolution-b06ecefc61581d7048df8b9bcd06896b75a459d0.zip |
** See bug #61761.
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.
svn path=/trunk/; revision=26709
-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 * |