+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
}
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;
}
if (nread == -1)
- ssl_error_to_errno (tcp_stream_openssl, -1);
+ ssl_error_to_errno (tcp_stream_openssl->priv->ssl, -1);
return nread;
}
}
if (written == -1)
- ssl_error_to_errno (tcp_stream_openssl, -1);
+ ssl_error_to_errno (tcp_stream_openssl->priv->ssl, -1);
return written;
}
n = SSL_connect (ssl);
if (n != 1) {
- ssl_error_to_errno (openssl, n);
+ ssl_error_to_errno (ssl, n);
SSL_shutdown (ssl);