aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/pop3
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-03-11 10:33:27 +0800
committerDan Winship <danw@src.gnome.org>2002-03-11 10:33:27 +0800
commit6024691d3c352e0c845672667cd2ef6a9e3bfdad (patch)
tree608115b1b394f0f64b7de202b599f6df4ccdb85c /camel/providers/pop3
parentb1b809031f5a11223d97ee02d21fb6bb3693a367 (diff)
downloadgsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.tar.gz
gsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.tar.zst
gsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.zip
Rename the OpenSSL implementation of things to match the NSS
implementation so that callers don't need to care which one is being used. * camel-tcp-stream-openssl.c: Implement CamelTcpStreamSSL, not CamelTcpStreamOpenSSL. Rename methods as well. Replace the camel-tcp-stream-openssl.h include with camel-tcp-stream-ssl.h. * camel-tcp-stream-openssl.h: Gone. * camel-tcp-stream-ssl.c: Add a note explaining that this implementation is only used for NSS, and that OpenSSL's implementation is in another file. (Should probably do some CVS renaming magic at some point.) * camel-http-stream.c (http_connect): Remove OpenSSL refs; the previously-NSS-specific code works for both now. * camel-remote-store.c: Likewise. * providers/smtp/camel-smtp-transport.c: Likewise. * providers/pop3/camel-pop3-store.c: Likewise. * Makefile.am (libcamelinclude_HEADERS): Remove camel-tcp-stream-openssl.h svn path=/trunk/; revision=16093
Diffstat (limited to 'camel/providers/pop3')
-rw-r--r--camel/providers/pop3/camel-pop3-store.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 515e982b95..5a9a8aa7f0 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -51,12 +51,8 @@
#include "camel-data-cache.h"
#include "camel-tcp-stream.h"
#include "camel-tcp-stream-raw.h"
-#ifdef HAVE_NSS
+#ifdef HAVE_SSL
#include "camel-tcp-stream-ssl.h"
-#include <prnetdb.h>
-#endif
-#ifdef HAVE_OPENSSL
-#include "camel-tcp-stream-openssl.h"
#endif
/* Specified in RFC 1939 */
@@ -161,30 +157,21 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, int *s
port = service->url->port ? service->url->port : 110;
-#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
+#ifdef HAVE_SSL
/* FIXME: check for "always" and "when-possible" to support STARTTLS */
if (camel_url_get_param (service->url, "use_ssl")) {
- if (!try_starttls)
- port = service->url->port ? service->url->port : 995;
-#ifdef HAVE_NSS
- /* this is the preferred SSL implementation */
if (try_starttls)
tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host);
- else
+ else {
+ port = service->url->port ? service->url->port : 995;
tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host);
-#else
- /* use openssl... */
- if (try_starttls)
- tcp_stream = camel_tcp_stream_openssl_new_raw (service, service->url->host);
- else
- tcp_stream = camel_tcp_stream_openssl_new (service, service->url->host);
-#endif /* HAVE_NSS */
+ }
} else {
tcp_stream = camel_tcp_stream_raw_new ();
}
#else
tcp_stream = camel_tcp_stream_raw_new ();
-#endif /* HAVE_NSS || HAVE_OPENSSL */
+#endif /* HAVE_SSL */
ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
camel_free_host (h);
@@ -211,7 +198,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, int *s
if (stls_support)
*stls_support = store->engine->capa & CAMEL_POP3_CAP_STLS;
-#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
+#ifdef HAVE_SSL
if (store->engine) {
if (ssl_mode == USE_SSL_WHEN_POSSIBLE) {
if (store->engine->capa & CAMEL_POP3_CAP_STLS)
@@ -233,13 +220,13 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, int *s
}
}
}
-#endif /* HAVE_NSS || HAVE_OPENSSL */
+#endif /* HAVE_SSL */
camel_object_unref (CAMEL_OBJECT (tcp_stream));
return store->engine != NULL;
-#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
+#ifdef HAVE_SSL
starttls:
/* as soon as we send a STLS command, all hope is lost of a clean QUIT if problems arise */
clean_quit = FALSE;
@@ -259,11 +246,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, int *s
}
/* Okay, now toggle SSL/TLS mode */
-#ifdef HAVE_NSS
ret = camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream));
-#else /* HAVE_OPENSSL */
- ret = camel_tcp_stream_openssl_enable_ssl (CAMEL_TCP_STREAM_OPENSSL (tcp_stream));
-#endif
camel_object_unref (CAMEL_OBJECT (tcp_stream));
@@ -294,7 +277,7 @@ connect_to_server (CamelService *service, int ssl_mode, int try_starttls, int *s
store->engine = NULL;
return FALSE;
-#endif /* HAVE_NSS || HAVE_OPENSSL */
+#endif /* HAVE_SSL */
}
static struct {
@@ -314,7 +297,7 @@ static struct {
static gboolean
connect_to_server_wrapper (CamelService *service, CamelException *ex)
{
-#if defined (HAVE_NSS) || defined (HAVE_OPENSSL)
+#ifdef HAVE_SSL
const char *use_ssl;
int stls_supported;
int i, ssl_mode;