diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-10-23 02:17:06 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-10-23 02:17:06 +0800 |
commit | 08af37f5686c80bad8b3ec88ab3f130d0827f977 (patch) | |
tree | 0bdb2f2ee39c503399cb05d9b0026dcdec14ab11 | |
parent | b6ca9198e820a5d0ca35bf497b957bd199f03c82 (diff) | |
download | gsoc2013-evolution-08af37f5686c80bad8b3ec88ab3f130d0827f977.tar.gz gsoc2013-evolution-08af37f5686c80bad8b3ec88ab3f130d0827f977.tar.zst gsoc2013-evolution-08af37f5686c80bad8b3ec88ab3f130d0827f977.zip |
Canonicalise the source_uri to not have a path. Fixes bug #32268.
2002-10-18 Jeffrey Stedfast <fejj@ximian.com>
* camel-filter-driver.c (camel_filter_driver_filter_folder):
Canonicalise the source_uri to not have a path. Fixes bug #32268.
2002-10-17 Jeffrey Stedfast <fejj@ximian.com>
Possible fix for bug #32270
* providers/pop3/camel-pop3-store.c (try_sasl): If we get an I/O
error, we should not be setting the CANT_AUTH exception but should
instead be setting the SYSTEM exception. Also check for EINTR
which signifies a USER_CANCEL exception.
(pop3_try_authenticate): If the auth mechanism isn't supported,
don't set the CANT_AUTH exception since then we will loop and try
again with the same data which will just cause an infinite loop.
(pop3_connect): Simplified a bit.
svn path=/trunk/; revision=18412
-rw-r--r-- | camel/ChangeLog | 27 | ||||
-rw-r--r-- | camel/camel-filter-driver.c | 13 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 55 |
3 files changed, 52 insertions, 43 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 4723610114..410266a4ef 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,21 @@ +2002-10-18 Jeffrey Stedfast <fejj@ximian.com> + + * camel-filter-driver.c (camel_filter_driver_filter_folder): + Canonicalise the source_uri to not have a path. Fixes bug #32268. + +2002-10-17 Jeffrey Stedfast <fejj@ximian.com> + + Possible fix for bug #32270 + + * providers/pop3/camel-pop3-store.c (try_sasl): If we get an I/O + error, we should not be setting the CANT_AUTH exception but should + instead be setting the SYSTEM exception. Also check for EINTR + which signifies a USER_CANCEL exception. + (pop3_try_authenticate): If the auth mechanism isn't supported, + don't set the CANT_AUTH exception since then we will loop and try + again with the same data which will just cause an infinite loop. + (pop3_connect): Simplified a bit. + 2002-10-17 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-ssl.c (camel_certdb_nss_cert_set): If @@ -28,11 +46,10 @@ 2002-10-03 Not Zed <NotZed@Ximian.com> - * camel-folder.c - (filter_filter): Do the filtering ourselves. This is so a problem - like a missing uid (which can happen legitemitely) doesn't - prematurely abort filtering. Stop on all other errors. See - #31667. + * camel-folder.c (filter_filter): Do the filtering ourselves. + This is so a problem like a missing uid (which can happen + legitemitely) doesn't prematurely abort filtering. Stop on all + other errors. See #31667. 2002-10-16 Jeffrey Stedfast <fejj@ximian.com> diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c index 7b229d5633..c9e71a9008 100644 --- a/camel/camel-filter-driver.c +++ b/camel/camel-filter-driver.c @@ -1036,7 +1036,6 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde gboolean freeuids = FALSE; CamelMessageInfo *info; char *source_url, *service_url; - const char *folder_name; int status = 0; CamelURL *url; int i; @@ -1045,18 +1044,6 @@ camel_filter_driver_filter_folder (CamelFilterDriver *driver, CamelFolder *folde url = camel_url_new (service_url, NULL); g_free (service_url); - folder_name = camel_folder_get_full_name (folder); - - if (folder_name && *folder_name != '/') { - char *path; - - path = g_strdup_printf ("/%s", folder_name); - camel_url_set_path (url, path); - g_free (path); - } else { - camel_url_set_path (url, folder_name); - } - source_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); camel_url_free (url); diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index 66125247ef..20c5640779 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -388,7 +388,7 @@ try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex) sasl = camel_sasl_new("pop3", mech, (CamelService *)store); if (sasl == NULL) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, _("Unable to connect to POP server %s: " "No support for requested authentication mechanism."), CAMEL_SERVICE (store)->url->host); @@ -430,11 +430,15 @@ try_sasl(CamelPOP3Store *store, const char *mech, CamelException *ex) } camel_object_unref((CamelObject *)sasl); return 0; - + ioerror: - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, - _("Failed to authenticate on POP server %s: %s"), - CAMEL_SERVICE (store)->url->host, g_strerror (errno)); + if (errno == EINTR) { + camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled")); + } else { + camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, + _("Failed to authenticate on POP server %s: %s"), + CAMEL_SERVICE (store)->url->host, g_strerror (errno)); + } done: camel_object_unref((CamelObject *)sasl); return -1; @@ -493,8 +497,8 @@ pop3_try_authenticate (CamelService *service, const char *errmsg, return try_sasl(store, service->url->authmech, ex) == -1; l = l->next; } - - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, + + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_URL_INVALID, _("Unable to connect to POP server %s: " "No support for requested authentication mechanism."), CAMEL_SERVICE (store)->url->host); @@ -503,13 +507,17 @@ pop3_try_authenticate (CamelService *service, const char *errmsg, while ((status = camel_pop3_engine_iterate(store->engine, pcp)) > 0) ; - - if (status == -1) - camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, - _("Unable to connect to POP server %s.\nError sending password: %s"), - CAMEL_SERVICE(store)->url->host, - errno?strerror(errno): _("Unknown error")); - else if (pcp->state != CAMEL_POP3_COMMAND_OK) + + if (status == -1) { + if (errno == EINTR) { + camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, _("Cancelled")); + } else { + camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, + _("Unable to connect to POP server %s.\nError sending password: %s"), + CAMEL_SERVICE (store)->url->host, + errno ? strerror (errno) : _("Unknown error")); + } + } else if (pcp->state != CAMEL_POP3_COMMAND_OK) camel_exception_setv(ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, _("Unable to connect to POP server %s.\nError sending password: %s"), CAMEL_SERVICE(store)->url->host, store->engine->line); @@ -552,20 +560,17 @@ pop3_connect (CamelService *service, CamelException *ex) status = pop3_try_authenticate(service, errbuf, ex); g_free(errbuf); errbuf = NULL; - - if (camel_exception_is_set(ex)) { + + /* we only re-prompt if we failed to authenticate, any other error and we just abort */ + if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE) { errbuf = g_strdup_printf("%s\n\n", camel_exception_get_description(ex)); - /* don't forget the password if we encountered an unknown error */ - if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE) { - /* Uncache the password before prompting again. */ - camel_session_forget_password(camel_service_get_session (service), - service, "password", NULL); - g_free(service->url->passwd); - service->url->passwd = NULL; - } + /* Uncache the password before prompting again. */ + camel_session_forget_password(camel_service_get_session (service), + service, "password", NULL); + g_free(service->url->passwd); + service->url->passwd = NULL; } - } while(status != -1 && ex->id == CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE); g_free(errbuf); |