diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-02-06 03:55:54 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-02-06 03:55:54 +0800 |
commit | ddfc033633f5db2c7f2c1a4de179d9029cbf1a6f (patch) | |
tree | 65cffcdf719d71a55a351122afc51d7be6d465fa /camel/providers/pop3/camel-pop3-store.c | |
parent | e582e23949ac7cb3e4d72ee50957a105ce30e1be (diff) | |
download | gsoc2013-evolution-ddfc033633f5db2c7f2c1a4de179d9029cbf1a6f.tar.gz gsoc2013-evolution-ddfc033633f5db2c7f2c1a4de179d9029cbf1a6f.tar.zst gsoc2013-evolution-ddfc033633f5db2c7f2c1a4de179d9029cbf1a6f.zip |
Updated.
2001-02-05 Jeffrey Stedfast <fejj@ximian.com>
* providers/smtp/camel-smtp-transport.c (query_auth_types): Updated.
* providers/nntp/camel-nntp-store.c (nntp_store_query_auth_types):
Updated.
* providers/pop3/camel-pop3-store.c (query_auth_types): Updated.
* providers/imap/camel-imap-store.c (query_auth_types): Updated.
* camel-service.c (camel_service_query_auth_types): Now takes a
boolean value to specify whether or not to connect when
constructing a supported authtype list.
svn path=/trunk/; revision=7979
Diffstat (limited to 'camel/providers/pop3/camel-pop3-store.c')
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 88 |
1 files changed, 46 insertions, 42 deletions
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index be59964b74..aefabebfa4 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -70,7 +70,7 @@ static void finalize (CamelObject *object); static gboolean pop3_connect (CamelService *service, CamelException *ex); static gboolean pop3_disconnect (CamelService *service, gboolean clean, CamelException *ex); -static GList *query_auth_types (CamelService *service, CamelException *ex); +static GList *query_auth_types (CamelService *service, gboolean connect, CamelException *ex); static CamelFolder *get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex); @@ -284,59 +284,63 @@ connect_to_server (CamelService *service, /*gboolean real, */CamelException *ex) } static GList * -query_auth_types (CamelService *service, CamelException *ex) +query_auth_types (CamelService *service, gboolean connect, CamelException *ex) { CamelPop3Store *store = CAMEL_POP3_STORE (service); - GList *ret = NULL; + GList *types = NULL; gboolean passwd = TRUE, apop = TRUE; #ifdef HAVE_KRB4 gboolean kpop = TRUE; int saved_port; #endif - - ret = CAMEL_SERVICE_CLASS (parent_class)->query_auth_types (service, ex); - - passwd = camel_service_connect (service, ex); - /*ignore the exception here; the server may just not support passwd */ - /*if (camel_exception_is_set (ex) != CAMEL_EXCEPTION_NONE)*/ - /*return NULL;*/ - /* should we check apop too? */ - apop = store->apop_timestamp != NULL; - if (passwd) - camel_service_disconnect (service, TRUE, ex); - camel_exception_clear (ex); - + types = CAMEL_SERVICE_CLASS (parent_class)->query_auth_types (service, connect, ex); + + if (connect) { + passwd = camel_service_connect (service, ex); + /*ignore the exception here; the server may just not support passwd */ + + /* should we check apop too? */ + apop = store->apop_timestamp != NULL; + if (passwd) + camel_service_disconnect (service, TRUE, ex); + camel_exception_clear (ex); + #ifdef HAVE_KRB4 - saved_port = service->url->port; - service->url->port = KPOP_PORT; - kpop = camel_service_connect (service, ex); - service->url->port = saved_port; - /*ignore the exception here; the server may just not support kpop */ - /*if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE)*/ - /*return NULL;*/ - - if (kpop) - camel_service_disconnect (service, TRUE, ex); - camel_exception_clear (ex); + saved_port = service->url->port; + service->url->port = KPOP_PORT; + kpop = camel_service_connect (service, ex); + service->url->port = saved_port; + /*ignore the exception here; the server may just not support kpop */ + + if (kpop) + camel_service_disconnect (service, TRUE, ex); + camel_exception_clear (ex); #endif - - if (passwd) - ret = g_list_append (ret, &password_authtype); - if (apop) - ret = g_list_append (ret, &apop_authtype); + + if (passwd) + types = g_list_append (types, &password_authtype); + if (apop) + types = g_list_append (types, &apop_authtype); #ifdef HAVE_KRB4 - if (kpop) - ret = g_list_append (ret, &kpop_authtype); + if (kpop) + types = g_list_append (types, &kpop_authtype); #endif - - if (!ret) { - camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, - _("Could not connect to POP server on " - "%s."), service->url->host); - } - - return ret; + + if (!types) { + camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, + _("Could not connect to POP server on " + "%s."), service->url->host); + } + } else { + types = g_list_append (types, &password_authtype); + types = g_list_append (types, &apop_authtype); +#ifdef HAVE_KRB4 + types = g_list_append (types, &kpop_authtype); +#endif + } + + return types; } /** |