diff options
author | Dan Winship <danw@src.gnome.org> | 2002-03-11 10:33:27 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2002-03-11 10:33:27 +0800 |
commit | 6024691d3c352e0c845672667cd2ef6a9e3bfdad (patch) | |
tree | 608115b1b394f0f64b7de202b599f6df4ccdb85c /camel/providers/smtp | |
parent | b1b809031f5a11223d97ee02d21fb6bb3693a367 (diff) | |
download | gsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.tar gsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.tar.gz gsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.tar.bz2 gsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.tar.lz gsoc2013-evolution-6024691d3c352e0c845672667cd2ef6a9e3bfdad.tar.xz 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/smtp')
-rw-r--r-- | camel/providers/smtp/camel-smtp-transport.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c index 26cf4aa17f..d45c617c02 100644 --- a/camel/providers/smtp/camel-smtp-transport.c +++ b/camel/providers/smtp/camel-smtp-transport.c @@ -49,12 +49,9 @@ #include "camel-stream-buffer.h" #include "camel-tcp-stream.h" #include "camel-tcp-stream-raw.h" -#ifdef HAVE_NSS +#ifdef HAVE_SSL #include "camel-tcp-stream-ssl.h" #endif -#ifdef HAVE_OPENSSL -#include "camel-tcp-stream-openssl.h" -#endif #include "camel-session.h" #include "camel-exception.h" #include "camel-sasl.h" @@ -261,28 +258,20 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex) port = service->url->port ? service->url->port : SMTP_PORT; -#if defined (HAVE_NSS) || defined (HAVE_OPENSSL) +#ifdef HAVE_SSL if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL) { - if (!try_starttls) - port = service->url->port ? service->url->port : 465; -#ifdef HAVE_NSS - /* use the preferred implementation - NSS */ if (try_starttls) tcp_stream = camel_tcp_stream_ssl_new_raw (service, service->url->host); - else + else { + port = service->url->port ? service->url->port : 465; tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host); -#else - 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); @@ -335,7 +324,7 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex) smtp_helo (transport, ex); } -#if defined (HAVE_NSS) || defined (HAVE_OPENSSL) +#ifdef HAVE_SSL if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_WHEN_POSSIBLE) { /* try_starttls is always TRUE here */ if (transport->flags & CAMEL_SMTP_TRANSPORT_STARTTLS) @@ -353,11 +342,11 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex) } } } -#endif /* HAVE_NSS || HAVE_OPENSSL */ +#endif /* HAVE_SSL */ return TRUE; -#if defined (HAVE_NSS) || defined (HAVE_OPENSSL) +#ifdef HAVE_SSL starttls: d(fprintf (stderr, "sending : STARTTLS\r\n")); if (camel_stream_write (tcp_stream, "STARTTLS\r\n", 10) == -1) { @@ -384,11 +373,7 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex) } while (*(respbuf+3) == '-'); /* if we got "220-" then loop again */ /* 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 if (ret != -1) return TRUE; @@ -403,7 +388,7 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex) transport->ostream = NULL; return FALSE; -#endif /* HAVE_NSS || HAVE_OPENSSL */ +#endif /* HAVE_SSL */ } #define EXCEPTION_RETRY(ex) (camel_exception_get_id (ex) != CAMEL_EXCEPTION_USER_CANCEL && \ @@ -412,7 +397,7 @@ connect_to_server (CamelService *service, int try_starttls, CamelException *ex) static gboolean connect_to_server_wrapper (CamelService *service, CamelException *ex) { -#if defined (HAVE_NSS) || defined (HAVE_OPENSSL) +#ifdef HAVE_SSL CamelSmtpTransport *transport = (CamelSmtpTransport *) service; if (transport->flags & CAMEL_SMTP_TRANSPORT_USE_SSL_ALWAYS) { |