From 59eb8e34ef6494dd612671bde8c14dfdf0fef958 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 28 Sep 2001 14:36:44 +0000 Subject: Make this take an SSL * instead of a CamelTcpStreamSSL *, since it can get * camel-tcp-stream-openssl.c (ssl_error_to_errno): Make this take an SSL * instead of a CamelTcpStreamSSL *, since it can get called from open_ssl_connection, when the CamelTcpStreamSSL isn't set up right yet. Fixes a crash on connection failure. svn path=/trunk/; revision=13213 --- camel/camel-tcp-stream-openssl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'camel/camel-tcp-stream-openssl.c') diff --git a/camel/camel-tcp-stream-openssl.c b/camel/camel-tcp-stream-openssl.c index 0d00468c5b..a940f2419a 100644 --- a/camel/camel-tcp-stream-openssl.c +++ b/camel/camel-tcp-stream-openssl.c @@ -184,11 +184,11 @@ errlib_error_to_errno (int ret) } static void -ssl_error_to_errno (CamelTcpStreamOpenSSL *stream, int ret) +ssl_error_to_errno (SSL *ssl, int ret) { /* hm, a CamelException might be useful right about now! */ - switch (SSL_get_error (stream->priv->ssl, ret)) { + switch (SSL_get_error (ssl, ret)) { case SSL_ERROR_NONE: errno = 0; return; @@ -271,7 +271,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n) } if (nread == -1) - ssl_error_to_errno (tcp_stream_openssl, -1); + ssl_error_to_errno (tcp_stream_openssl->priv->ssl, -1); return nread; } @@ -337,7 +337,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n) } if (written == -1) - ssl_error_to_errno (tcp_stream_openssl, -1); + ssl_error_to_errno (tcp_stream_openssl->priv->ssl, -1); return written; } @@ -526,7 +526,7 @@ open_ssl_connection (CamelService *service, int sockfd, CamelTcpStreamOpenSSL *o n = SSL_connect (ssl); if (n != 1) { - ssl_error_to_errno (openssl, n); + ssl_error_to_errno (ssl, n); SSL_shutdown (ssl); -- cgit