changeset 8362:1976914caa51

[gaim-migrate @ 9087] made SSL error handling a little better committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 28 Feb 2004 21:14:51 +0000
parents 8ef2f2043902
children 19459d9eead2
files plugins/ssl/ssl-gnutls.c plugins/ssl/ssl-nss.c src/protocols/jabber/JEPS src/protocols/jabber/jabber.c src/sslconn.h
diffstat 5 files changed, 17 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ssl/ssl-gnutls.c	Sat Feb 28 20:28:22 2004 +0000
+++ b/plugins/ssl/ssl-gnutls.c	Sat Feb 28 21:14:51 2004 +0000
@@ -72,8 +72,13 @@
 	static const int cert_type_priority[2] = { GNUTLS_CRT_X509, 0 };
 	int ret;
 
-	if (source < 0)
+	if (source < 0) {
+		if(gsc->error_cb != NULL)
+			gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data);
+
+		gaim_ssl_close(gsc);
 		return;
+	}
 
 	gsc->fd = source;
 
--- a/plugins/ssl/ssl-nss.c	Sat Feb 28 20:28:22 2004 +0000
+++ b/plugins/ssl/ssl-nss.c	Sat Feb 28 21:14:51 2004 +0000
@@ -170,6 +170,9 @@
 	{
 		gaim_debug_error("nss", "nss_data->fd == NULL!\n");
 
+		if (gsc->error_cb != NULL)
+			gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data);
+
 		gaim_ssl_close((GaimSslConnection *)gsc);
 
 		return;
@@ -186,6 +189,9 @@
 	{
 		gaim_debug_error("nss", "nss_data->in == NUL!\n");
 
+		if (gsc->error_cb != NULL)
+			gsc->error_cb(gsc, GAIM_SSL_CONNECT_FAILED, gsc->connect_cb_data);
+
 		gaim_ssl_close((GaimSslConnection *)gsc);
 
 		return;
--- a/src/protocols/jabber/JEPS	Sat Feb 28 20:28:22 2004 +0000
+++ b/src/protocols/jabber/JEPS	Sat Feb 28 21:14:51 2004 +0000
@@ -4,8 +4,6 @@
 	In-Band Bytestreams
 0060: NEED
 	Pub-Sub
-0065: IN PROGRESS
-	SOCKS5 Bytestreams
 0071: AWAITING FINAL SPEC
 	XHTML-IM
 0073: NEED
@@ -20,10 +18,6 @@
 	Generic Alerts
 0093: NEED
 	Roster Item Exchange
-0095: IN PROGRESS
-	Stream Initiation
-0096: IN PROGRESS
-	File Transfer Stream Initiation Profile
 0100: NEED
 	Gateway Interaction (Transports)
 0115: WATCH
--- a/src/protocols/jabber/jabber.c	Sat Feb 28 20:28:22 2004 +0000
+++ b/src/protocols/jabber/jabber.c	Sat Feb 28 21:14:51 2004 +0000
@@ -359,6 +359,9 @@
 	JabberStream *js = gc->proto_data;
 
 	switch(error) {
+		case GAIM_SSL_CONNECT_FAILED:
+			gaim_connection_error(gc, _("Connection Failed"));
+			break;
 		case GAIM_SSL_HANDSHAKE_FAILED:
 			gaim_connection_error(gc, _("SSL Handshake Failed"));
 			break;
--- a/src/sslconn.h	Sat Feb 28 20:28:22 2004 +0000
+++ b/src/sslconn.h	Sat Feb 28 21:14:51 2004 +0000
@@ -31,8 +31,8 @@
 
 typedef enum
 {
-	GAIM_SSL_HANDSHAKE_FAILED = 1
-
+	GAIM_SSL_HANDSHAKE_FAILED = 1,
+	GAIM_SSL_CONNECT_FAILED = 2
 } GaimSslErrorType;
 
 typedef struct _GaimSslConnection GaimSslConnection;