+2001-09-06 Dan Winship <danw@ximian.com>
+
+ * 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 <fejj@ximian.com>
* providers/pop3/camel-pop3-folder.c (pop3_get_message_stream):
#include <stdlib.h>
#include <string.h>
-#include <errno.h>
-
#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
static CamelFolderClass *parent_class;
&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;
}
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) {