diff options
-rw-r--r-- | camel/ChangeLog | 7 | ||||
-rw-r--r-- | camel/camel-tcp-stream-openssl.c | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 837aee044e..7641449212 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2001-09-28 Dan Winship <danw@ximian.com> + + * 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. + 2001-09-27 Dan Winship <danw@ximian.com> * providers/imap/camel-imap-folder.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); |