aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-tcp-stream-ssl.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-03-15 05:59:40 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-03-15 05:59:40 +0800
commit174adfa471581f0a322b4e381d9671b2b50ac9d4 (patch)
treed3cbf73426097bb481593a6b8c3b7e0c4b1e32b3 /camel/camel-tcp-stream-ssl.c
parent4391d0f3b1d03097f8e4fffd24857e54f8ea1eec (diff)
downloadgsoc2013-evolution-174adfa471581f0a322b4e381d9671b2b50ac9d4.tar.gz
gsoc2013-evolution-174adfa471581f0a322b4e381d9671b2b50ac9d4.tar.zst
gsoc2013-evolution-174adfa471581f0a322b4e381d9671b2b50ac9d4.zip
Numerous fixes to get it to build correctly with NSS enabled.
2001-03-14 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-ssl.c: Numerous fixes to get it to build correctly with NSS enabled. * camel-remote-store.c (remote_connect): Pass in the session and expected host args, oops. * camel-provider.h (CAMEL_URL_ALLOW_SSL): Defined. * providers/imap/camel-imap-store.c (camel_imap_store_init): Check to see if we are supposed to use SSL and set the options accordingly. (imap_connect): Return FALSE here instead of NULL. * providers/imap/camel-imap-provider.c: Add CAMEL_URL_ALLOW_SSL. * providers/imap/libcamelimap.urls: Add "imaps" which is the protocol for Secure IMAP. svn path=/trunk/; revision=8711
Diffstat (limited to 'camel/camel-tcp-stream-ssl.c')
-rw-r--r--camel/camel-tcp-stream-ssl.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 8d4ac47746..42c50eccca 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -31,7 +31,10 @@
#include <fcntl.h>
#include <errno.h>
#include <string.h>
-#include <mozilla/nspr.h>
+#include <nspr.h>
+#include <prio.h>
+#include <prerror.h>
+#include <prerr.h>
#include <nss.h>
#include <ssl.h>
@@ -194,13 +197,13 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
static int
stream_flush (CamelStream *stream)
{
- return PR_Fsync (((CamelTcpStreamSSL *)stream)->sockfd);
+ return PR_Sync (((CamelTcpStreamSSL *)stream)->sockfd);
}
static int
stream_close (CamelStream *stream)
{
- if (PR_Close (((CamelTcpStreamSSL *)stream)->sockfd) == PR_Failure)
+ if (PR_Close (((CamelTcpStreamSSL *)stream)->sockfd) == PR_FAILURE)
return -1;
((CamelTcpStreamSSL *)stream)->sockfd = NULL;
@@ -229,7 +232,7 @@ ssl_bad_cert (void *data, PRFileDesc *fd)
session = CAMEL_SESSION (data);
/* FIXME: International issues here?? */
- len = PR_GetErrorTextLen (PR_GetError ());
+ len = PR_GetErrorTextLength ();
string = g_malloc0 (len + 1);
PR_GetErrorText (string);
@@ -246,7 +249,7 @@ static int
stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
{
CamelTcpStreamSSL *ssl = CAMEL_TCP_STREAM_SSL (stream);
- PRIntervalTime timeout;
+ PRIntervalTime timeout = PR_INTERVAL_MIN;
PRNetAddr netaddr;
PRFileDesc *fd, *ssl_fd;
@@ -255,13 +258,13 @@ stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
memset ((void *) &netaddr, 0, sizeof (PRNetAddr));
memcpy (&netaddr.inet.ip, host->h_addr, sizeof (netaddr.inet.ip));
- if (PR_InitializeNetAddr (PR_IpAddrNull, port, &netaddr) == PR_FAILUE)
+ if (PR_InitializeNetAddr (PR_IpAddrNull, port, &netaddr) == PR_FAILURE)
return -1;
fd = PR_OpenTCPSocket (host->h_addrtype);
ssl_fd = SSL_ImportFD (NULL, fd);
- SSL_SetUrl (ssl_fd, ssl->expected_host);
+ SSL_SetURL (ssl_fd, ssl->expected_host);
if (ssl_fd == NULL || PR_Connect (ssl_fd, &netaddr, timeout) == PR_FAILURE) {
if (ssl_fd != NULL)
@@ -303,7 +306,7 @@ stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data)
memset ((void *) &sodata, 0, sizeof (sodata));
memcpy ((void *) &sodata, (void *) data, sizeof (CamelSockOptData));
- if (PR_SetSocketOption (((CamelTcpStreamRaw *)stream)->sockfd, &sodata) == PR_FAILURE)
+ if (PR_SetSocketOption (((CamelTcpStreamSSL *)stream)->sockfd, &sodata) == PR_FAILURE)
return -1;
return 0;