From b5e4fe865ef94a8dd1988302fdbe61275a0d2f03 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 6 Sep 2001 19:09:57 +0000 Subject: Fix this to always set an exception if it returns POP3_FAIL, as * providers/pop3/camel-pop3-store.c (pop3_get_response): Fix this to always set an exception if it returns POP3_FAIL, as documented. * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream): Revert. svn path=/trunk/; revision=12654 --- camel/ChangeLog | 8 ++++++++ camel/providers/pop3/camel-pop3-folder.c | 8 +++----- camel/providers/pop3/camel-pop3-store.c | 6 +++++- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 763901dda3..c4b8905b86 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2001-09-06 Dan Winship + + * providers/pop3/camel-pop3-store.c (pop3_get_response): Fix this + to always set an exception if it returns POP3_FAIL, as documented. + + * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream): + Revert. + 2001-09-06 Jeffrey Stedfast * providers/pop3/camel-pop3-folder.c (pop3_get_message_stream): diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index a87c77f3a1..d18680dddd 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -40,8 +40,6 @@ #include #include -#include - #define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o))) static CamelFolderClass *parent_class; @@ -333,11 +331,11 @@ pop3_get_message_stream (CamelFolder *folder, int id, gboolean headers_only, Cam &result, ex, headers_only ? "TOP %d 0" : "RETR %d", id); switch (status) { case CAMEL_POP3_ERR: - case CAMEL_POP3_FAIL: camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - _("Could not fetch message: %s"), result ? result : - errno ? g_strerror (errno) : _("Unknown error")); + _("Could not fetch message: %s"), result); g_free (result); + /* fall through */ + case CAMEL_POP3_FAIL: camel_operation_end (NULL); return NULL; } diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 8a0f8b6cc9..e5f6144ea6 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -561,8 +561,12 @@ pop3_get_response (CamelPop3Store *store, char **ret, CamelException *ex) status = CAMEL_POP3_OK; else if (!strncmp (respbuf, "-ERR", 4)) status = CAMEL_POP3_ERR; - else + else { status = CAMEL_POP3_FAIL; + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, + _("Unexpected response from POP server: %s"), + respbuf); + } if (ret) { if (status != CAMEL_POP3_FAIL) { -- cgit v1.2.3