From 71447cb8c404925552da5719153dbe66a8843b0e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 8 May 2002 06:40:41 +0000 Subject: camel_pop3_engine_iterate doesn't return the state, it returns -1 on fail, 2002-05-08 Jeffrey Stedfast * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): camel_pop3_engine_iterate doesn't return the state, it returns -1 on fail, 0 when finished processing request or >0 if more ops are in the queue, so don't check status against CAMEL_POP3_STATE_OK, instead check pcp->state against that. svn path=/trunk/; revision=16719 --- camel/ChangeLog | 8 ++++++++ camel/providers/pop3/camel-pop3-store.c | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index b8ef9d800e..b00ff2b246 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2002-05-08 Jeffrey Stedfast + + * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): + camel_pop3_engine_iterate doesn't return the state, it returns -1 + on fail, 0 when finished processing request or >0 if more ops are + in the queue, so don't check status against CAMEL_POP3_STATE_OK, + instead check pcp->state against that. + 2002-05-07 Jeffrey Stedfast * camel-object.h: s/class/klass for arguments so that c++ diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index ebf55ccd10..4015cb6ea1 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -495,18 +495,18 @@ pop3_try_authenticate (CamelService *service, const char *errmsg, return FALSE; } - while ((status = camel_pop3_engine_iterate(store->engine, pcp)) > 0) + while ((status = camel_pop3_engine_iterate (store->engine, pcp)) > 0) ; - if (status != CAMEL_POP3_COMMAND_OK) { - if (status == CAMEL_POP3_COMMAND_ERR) - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - _("Unable to connect to POP server.\nError sending password: %s"), - store->engine->line); - else + if (pcp->state != CAMEL_POP3_COMMAND_OK) { + if (status == -1) camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to connect to POP server.\nError sending password: %s"), errno ? g_strerror (errno) : _("Unknown error")); + else + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, + _("Unable to connect to POP server.\nError sending password: %s"), + store->engine->line); } camel_pop3_engine_command_free(store->engine, pcp); -- cgit v1.2.3