diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-03-19 05:31:25 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-03-19 05:31:25 +0800 |
commit | ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f (patch) | |
tree | 9bac625073d1993020aeb758194a7bbdf2fb0be2 | |
parent | 91c17571fdc9048b4fb4a0dbf6e6feca9c7b2a69 (diff) | |
download | gsoc2013-evolution-ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f.tar gsoc2013-evolution-ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f.tar.gz gsoc2013-evolution-ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f.tar.bz2 gsoc2013-evolution-ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f.tar.lz gsoc2013-evolution-ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f.tar.xz gsoc2013-evolution-ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f.tar.zst gsoc2013-evolution-ae8129bbb2d1607c0776ec3e6bbe0a7791fec33f.zip |
No longer takes a stls_supported argument since we no longer need it with
2002-03-18 Jeffrey Stedfast <fejj@ximian.com>
* providers/pop3/camel-pop3-store.c (connect_to_server): No longer
takes a stls_supported argument since we no longer need it with
the new logic.
(connect_to_server_wrapper): New logic: First try connecting to
the SSL port (995 by default), if that fails with
SERVICE_UNAVAILABLE, then we attempt to connect (to port 110 by
default) and try to use STARTTLS.
svn path=/trunk/; revision=16202
-rw-r--r-- | camel/ChangeLog | 12 | ||||
-rw-r--r-- | camel/providers/pop3/camel-pop3-store.c | 25 |
2 files changed, 21 insertions, 16 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 6733023606..d6af52d537 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,17 @@ +2002-03-18 Jeffrey Stedfast <fejj@ximian.com> + + * providers/pop3/camel-pop3-store.c (connect_to_server): No longer + takes a stls_supported argument since we no longer need it with + the new logic. + (connect_to_server_wrapper): New logic: First try connecting to + the SSL port (995 by default), if that fails with + SERVICE_UNAVAILABLE, then we attempt to connect (to port 110 by + default) and try to use STARTTLS. + 2002-03-15 Jeffrey Stedfast <fejj@ximian.com> + * camel-folder.h: + * camel-private.h: Don't allow any empty structs. If !ENABLE_THREADS, provide a gpointer dummy member. Fixes bug #6382. diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c index e441531c05..dcdeefb392 100644 --- a/camel/providers/pop3/camel-pop3-store.c +++ b/camel/providers/pop3/camel-pop3-store.c @@ -142,7 +142,7 @@ enum { }; static gboolean -connect_to_server (CamelService *service, int ssl_mode, int try_starttls, int *stls_support, CamelException *ex) +connect_to_server (CamelService *service, int ssl_mode, int try_starttls, CamelException *ex) { CamelPOP3Store *store = CAMEL_POP3_STORE (service); CamelStream *tcp_stream; @@ -195,9 +195,6 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, int *s #ifdef HAVE_SSL if (store->engine) { - if (stls_support) - *stls_support = store->engine->capa & CAMEL_POP3_CAP_STLS; - if (ssl_mode == USE_SSL_WHEN_POSSIBLE) { if (store->engine->capa & CAMEL_POP3_CAP_STLS) goto starttls; @@ -289,15 +286,11 @@ static struct { { NULL, USE_SSL_NEVER }, }; -#define EXCEPTION_RETRY(ex) (camel_exception_get_id (ex) != CAMEL_EXCEPTION_USER_CANCEL && \ - camel_exception_get_id (ex) != CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) - static gboolean connect_to_server_wrapper (CamelService *service, CamelException *ex) { #ifdef HAVE_SSL const char *use_ssl; - int stls_supported; int i, ssl_mode; use_ssl = camel_url_get_param (service->url, "use_ssl"); @@ -310,12 +303,12 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex) ssl_mode = USE_SSL_NEVER; if (ssl_mode == USE_SSL_ALWAYS) { - /* First try STARTTLS */ - if (!connect_to_server (service, ssl_mode, TRUE, &stls_supported, ex)) { - if (!stls_supported && EXCEPTION_RETRY (ex)) { - /* STARTTLS is unavailable - okay, now try old-style SSL */ + /* First try the ssl port */ + if (!connect_to_server (service, ssl_mode, FALSE, ex)) { + if (camel_exception_get_id (ex) == CAMEL_EXCEPTION_SERVICE_UNAVAILABLE) { + /* The ssl port seems to be unavailable, lets try STARTTLS */ camel_exception_clear (ex); - return connect_to_server (service, ssl_mode, FALSE, NULL, ex); + return connect_to_server (service, ssl_mode, TRUE, ex); } else { return FALSE; } @@ -324,13 +317,13 @@ connect_to_server_wrapper (CamelService *service, CamelException *ex) return TRUE; } else if (ssl_mode == USE_SSL_WHEN_POSSIBLE) { /* If the server supports STARTTLS, use it */ - return connect_to_server (service, ssl_mode, TRUE, NULL, ex); + return connect_to_server (service, ssl_mode, TRUE, ex); } else { /* User doesn't care about SSL */ - return connect_to_server (service, ssl_mode, FALSE, NULL, ex); + return connect_to_server (service, ssl_mode, FALSE, ex); } #else - return connect_to_server (service, USE_SSL_NEVER, FALSE, NULL, ex); + return connect_to_server (service, USE_SSL_NEVER, FALSE, ex); #endif } |