From: <the...@us...> - 2006-08-21 02:42:20
|
Revision: 16932 Author: thekingant Date: 2006-08-20 19:42:14 -0700 (Sun, 20 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16932&view=rev Log Message: ----------- More sslconn improvements Modified Paths: -------------- trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/novell/novell.c trunk/libgaim/sslconn.h Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-21 02:21:51 UTC (rev 16931) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-21 02:42:14 UTC (rev 16932) @@ -407,13 +407,6 @@ GaimConnection *gc = data; JabberStream *js = gc->proto_data; - if(!g_list_find(gaim_connections_get_all(), gc)) { - gaim_ssl_close(gsc); - return; - } - - js->gsc = gsc; - if(js->state == JABBER_STREAM_CONNECTING) jabber_send_raw(js, "<?xml version='1.0' ?>", -1); jabber_stream_set_state(js, JABBER_STREAM_INITIALIZING); @@ -450,6 +443,8 @@ GaimConnection *gc = data; JabberStream *js = gc->proto_data; + js->gsc = NULL; + switch(error) { case GAIM_SSL_CONNECT_FAILED: gaim_connection_error(gc, _("Connection Failed")); @@ -458,8 +453,6 @@ gaim_connection_error(gc, _("SSL Handshake Failed")); break; } - - js->gsc = NULL; } static void tls_init(JabberStream *js) Modified: trunk/libgaim/protocols/novell/novell.c =================================================================== --- trunk/libgaim/protocols/novell/novell.c 2006-08-21 02:21:51 UTC (rev 16931) +++ trunk/libgaim/protocols/novell/novell.c 2006-08-21 02:42:14 UTC (rev 16932) @@ -1663,8 +1663,14 @@ novell_ssl_connect_error(GaimSslConnection * gsc, GaimSslErrorType error, gpointer data) { - gaim_connection_error((GaimConnection *)data, - _("Unable to make SSL connection to server.")); + GaimConnection *gc; + NMUser *user; + + gc = data; + user = gc->proto_data; + user->conn->ssl_conn->data = NULL; + + gaim_connection_error(gc, _("Unable to make SSL connection to server.")); } static void @@ -1717,7 +1723,6 @@ return; conn->ssl_conn = g_new0(NMSSLConn, 1); - conn->ssl_conn->data = gsc; conn->ssl_conn->read = (nm_ssl_read_cb) gaim_ssl_read; conn->ssl_conn->write = (nm_ssl_write_cb) gaim_ssl_write; @@ -2182,9 +2187,10 @@ 1, NOVELL_CONNECT_STEPS); user->conn->use_ssl = TRUE; - if (gaim_ssl_connect(user->client_data, user->conn->addr, - user->conn->port, novell_ssl_connected_cb, - novell_ssl_connect_error, gc) == NULL) { + user->conn->ssl_conn->data = gaim_ssl_connect(user->client_data, + user->conn->addr, user->conn->port, + novell_ssl_connected_cb, novell_ssl_connect_error, gc); + if (user->conn->ssl_conn->data == NULL) { gaim_connection_error(gc, _("Error." " SSL support is not installed.")); } Modified: trunk/libgaim/sslconn.h =================================================================== --- trunk/libgaim/sslconn.h 2006-08-21 02:21:51 UTC (rev 16931) +++ trunk/libgaim/sslconn.h 2006-08-21 02:42:14 UTC (rev 16932) @@ -92,13 +92,18 @@ gboolean gaim_ssl_is_supported(void); /** - * Makes a SSL connection to the specified host and port. + * Makes a SSL connection to the specified host and port. The caller + * should keep track of the returned value and use it to cancel the + * connection, if needed. * * @param account The account making the connection. * @param host The destination host. * @param port The destination port. * @param func The SSL input handler function. - * @param error_func The SSL error handler function. + * @param error_func The SSL error handler function. This function + * should NOT call gaim_ssl_close(). In the event + * of an error the GaimSslConnection will be + * destroyed for you. * @param data User-defined data. * * @return The SSL connection handle. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |