changeset 14108:7a205b430d19

[gaim-migrate @ 16742] Removing the "error_cb" parameter for gaim_proxy_connect(), changing it back to how it was. As I started making changes to oscar to support canceling connection attempts, I realized that having a separate callback for errors would result in more code duplication than was needed. Originally I thought the separate callback would make things cleaner. Anyway, sorry for the noise. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 14 Aug 2006 04:43:38 +0000
parents c0ee28af3ca2
children a21da42126d6
files plugins/ChangeLog.API src/ft.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/jabber/si.c src/protocols/msn/directconn.c src/protocols/msn/httpconn.c src/protocols/msn/servconn.c src/protocols/oscar/oscar.c src/protocols/oscar/peer.c src/protocols/qq/qq_proxy.c src/protocols/sametime/sametime.c src/protocols/silc/silc.c src/protocols/simple/simple.c src/protocols/yahoo/yahoo.c src/protocols/yahoo/yahoo_filexfer.c src/protocols/yahoo/yahoo_picture.c src/protocols/yahoo/yahoochat.c src/protocols/yahoo/ycht.c src/proxy.c src/proxy.h src/sslconn.c src/upnp.c src/util.c
diffstat 24 files changed, 55 insertions(+), 80 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ChangeLog.API	Mon Aug 14 02:16:58 2006 +0000
+++ b/plugins/ChangeLog.API	Mon Aug 14 04:43:38 2006 +0000
@@ -114,9 +114,9 @@
 	* All network activity has been updated to use non-blocking sockets.
 	  This means that plugins must be updated to expect such a socket from
 	  gaim_proxy_connect() and gaim_network_listen*().
-	* gaim_proxy_connect(): changed to return NULL on error and a void *
-	  handle on success, and changed parameters.  It is now possible to
-	  cancel connection attempts.
+	* gaim_proxy_connect(): changed to return NULL on error and a pointer
+	  to a GaimProxyConnectInfo object which can be used to cancel
+	  connection attempts using gaim_proxy_connect_cancel().
 	* gaim_gtk_create_imhtml(): Added sw_ret() parameter
 	* gaim_account_get_log(): Added create parameter
 	* GAIM_CMD_P_VERYHIGH is now GAIM_CMD_P_VERY_HIGH
--- a/src/ft.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/ft.c	Mon Aug 14 04:43:38 2006 +0000
@@ -946,7 +946,7 @@
 
 			/* Establish a file descriptor. */
 			gaim_proxy_connect(xfer->account, xfer->remote_ip,
-							   xfer->remote_port, connect_cb, NULL, xfer);
+							   xfer->remote_port, connect_cb, xfer);
 
 			return;
 		}
--- a/src/protocols/irc/irc.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/irc/irc.c	Mon Aug 14 04:43:38 2006 +0000
@@ -327,7 +327,7 @@
 
 		connect_info = gaim_proxy_connect(account, irc->server,
 				 gaim_account_get_int(account, "port", IRC_DEFAULT_PORT),
-				 irc_login_cb, NULL, gc);
+				 irc_login_cb, gc);
 
 		if (!connect_info || !gaim_account_get_connection(account)) {
 			gaim_connection_error(gc, _("Couldn't create socket"));
--- a/src/protocols/jabber/jabber.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Aug 14 04:43:38 2006 +0000
@@ -477,7 +477,7 @@
 	GaimProxyConnectInfo *connect_info;
 
 	connect_info = gaim_proxy_connect(js->gc->account, server,
-			port, jabber_login_callback, NULL, js->gc);
+			port, jabber_login_callback, js->gc);
 
 	if (connect_info == NULL)
 		gaim_connection_error(js->gc, _("Unable to create socket"));
@@ -914,7 +914,7 @@
 	if(!js->gsc) {
 		connect_info = gaim_proxy_connect(account, server,
 				gaim_account_get_int(account, "port", 5222),
-				jabber_login_callback, NULL, gc);
+				jabber_login_callback, gc);
 
 		if (connect_info == NULL)
 			gaim_connection_error(gc, _("Unable to create socket"));
--- a/src/protocols/jabber/si.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/jabber/si.c	Mon Aug 14 04:43:38 2006 +0000
@@ -167,7 +167,7 @@
 	for(i=0; i<20; i++, p+=2)
 		snprintf(p, 3, "%02x", hashval[i]);
 
-	gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, jabber_si_bytestreams_connect_cb, NULL, xfer);
+	gaim_proxy_connect_socks5(jsx->gpi, dstaddr, 0, jabber_si_bytestreams_connect_cb, xfer);
 	g_free(dstaddr);
 }
 
--- a/src/protocols/msn/directconn.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/msn/directconn.c	Mon Aug 14 04:43:38 2006 +0000
@@ -439,7 +439,7 @@
 #endif
 
 	connect_info = gaim_proxy_connect(session->account, host, port,
-						   connect_cb, NULL, directconn);
+						   connect_cb, directconn);
 
 	if (connect_info != NULL)
 	{
--- a/src/protocols/msn/httpconn.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/msn/httpconn.c	Mon Aug 14 04:43:38 2006 +0000
@@ -739,7 +739,7 @@
 		msn_httpconn_disconnect(httpconn);
 
 	connect_info = gaim_proxy_connect(httpconn->session->account,
-		"gateway.messenger.hotmail.com", 80, connect_cb, NULL, httpconn);
+		"gateway.messenger.hotmail.com", 80, connect_cb, httpconn);
 
 	if (connect_info != NULL)
 	{
--- a/src/protocols/msn/servconn.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/msn/servconn.c	Mon Aug 14 04:43:38 2006 +0000
@@ -233,7 +233,7 @@
 	}
 
 	connect_info = gaim_proxy_connect(session->account, host, port,
-		connect_cb, NULL, servconn);
+		connect_cb, servconn);
 
 	if (connect_info != NULL)
 	{
--- a/src/protocols/oscar/oscar.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Aug 14 04:43:38 2006 +0000
@@ -1250,7 +1250,7 @@
 	if (gaim_proxy_connect(account,
 			gaim_account_get_string(account, "server", OSCAR_DEFAULT_LOGIN_SERVER),
 			gaim_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT),
-			connection_established_cb, NULL, new_conn_data) == NULL)
+			connection_established_cb, new_conn_data) == NULL)
 	{
 		gaim_connection_error(gc, _("Couldn't connect to host"));
 		return;
@@ -1368,7 +1368,7 @@
 	new_conn_data->cookie = g_memdup(info->cookie, info->cookielen);
 	new_conn_data->data = NULL;
 	connect_info = gaim_proxy_connect(gc->account, host, port,
-			connection_established_cb, NULL, new_conn_data);
+			connection_established_cb, new_conn_data);
 	g_free(host);
 	if (connect_info == NULL) {
 		gaim_connection_error(gc, _("Could Not Connect"));
@@ -1574,7 +1574,7 @@
 	pos->modname = g_strdup(modname);
 
 	if (gaim_proxy_connect(pos->gc->account, "gaim.sourceforge.net", 80,
-			straight_to_hell, NULL, pos) == NULL)
+			straight_to_hell, pos) == NULL)
 	{
 		char buf[256];
 		if (pos->modname)
@@ -1665,7 +1665,7 @@
 		new_conn_data->data = NULL;
 	}
 
-	if (gaim_proxy_connect(account, host, port, connection_established_cb, NULL, new_conn_data) == NULL)
+	if (gaim_proxy_connect(account, host, port, connection_established_cb, new_conn_data) == NULL)
 	{
 		flap_connection_schedule_destroy(new_conn_data->conn,
 				OSCAR_DISCONNECT_COULD_NOT_CONNECT);
--- a/src/protocols/oscar/peer.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/oscar/peer.c	Mon Aug 14 04:43:38 2006 +0000
@@ -706,7 +706,7 @@
 
 		conn->connect_info = gaim_proxy_connect(account,
 				conn->verifiedip, conn->port,
-				peer_connection_established_cb, NULL, conn);
+				peer_connection_established_cb, conn);
 		if (conn->connect_info != NULL)
 		{
 			/* Connecting... */
@@ -741,7 +741,7 @@
 
 			conn->connect_info = gaim_proxy_connect(account,
 					conn->clientip, conn->port,
-					peer_connection_established_cb, NULL, conn);
+					peer_connection_established_cb, conn);
 			if (conn->connect_info != NULL)
 			{
 				/* Connecting... */
@@ -813,7 +813,7 @@
 		conn->connect_info = gaim_proxy_connect(account,
 				(conn->proxyip != NULL) ? conn->proxyip : PEER_PROXY_SERVER,
 				PEER_PROXY_PORT,
-				peer_proxy_connection_established_cb, NULL, conn);
+				peer_proxy_connection_established_cb, conn);
 		if (conn->connect_info != NULL)
 		{
 			/* Connecting... */
--- a/src/protocols/qq/qq_proxy.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/qq/qq_proxy.c	Mon Aug 14 04:43:38 2006 +0000
@@ -321,7 +321,7 @@
 
 	if (use_tcp)
 		/* TCP mode */
-		return (gaim_proxy_connect(account, host, port, func, NULL, data) == NULL);
+		return (gaim_proxy_connect(account, host, port, func, data) == NULL);
 	else
 		/* UDP mode */
 		return _qq_udp_proxy_connect(account, host, port, func, data);
--- a/src/protocols/sametime/sametime.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/sametime/sametime.c	Mon Aug 14 04:43:38 2006 +0000
@@ -4,17 +4,17 @@
   Adds Lotus Sametime support to Gaim using the Meanwhile library
 
   Copyright (C) 2004 Christopher (siege) O'Brien <siege@preoccupied.net>
-  
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or (at
   your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.
-  
+
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
@@ -1409,7 +1409,7 @@
   port = gaim_account_get_int(account, MW_KEY_PORT, MW_PLUGIN_DEFAULT_PORT);
 
   if(gaim_account_get_bool(account, MW_KEY_FORCE, FALSE) ||
-     (gaim_proxy_connect(account, host, port, connect_cb, NULL, pd) == NULL)) {
+     (gaim_proxy_connect(account, host, port, connect_cb, pd) == NULL)) {
 
     mwSession_forceLogin(session);
   }
@@ -3683,7 +3683,7 @@
 
   gaim_connection_update_progress(gc, _("Connecting"), 1, MW_CONNECT_STEPS);
 
-  if(gaim_proxy_connect(account, host, port, connect_cb, NULL, pd) == NULL) {
+  if(gaim_proxy_connect(account, host, port, connect_cb, pd) == NULL) {
     gaim_connection_error(gc, _("Unable to connect to host"));
   }
 }
--- a/src/protocols/silc/silc.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/silc/silc.c	Mon Aug 14 04:43:38 2006 +0000
@@ -367,7 +367,7 @@
 			       gaim_account_get_string(account, "server",
 						       "silc.silcnet.org"),
 			       gaim_account_get_int(account, "port", 706),
-			       silcgaim_login_connected, NULL, gc) == NULL)
+			       silcgaim_login_connected, gc) == NULL)
 	{
 		gaim_connection_error(gc, _("Unable to create connection"));
 		return;
--- a/src/protocols/simple/simple.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/simple/simple.c	Mon Aug 14 04:43:38 2006 +0000
@@ -452,7 +452,7 @@
 
 	if(!sip->connecting) {
 		gaim_debug_info("simple", "connecting to %s port %d\n", sip->realhostname ? sip->realhostname : "{NULL}", sip->realport);
-		connect_info = gaim_proxy_connect(sip->account, sip->realhostname, sip->realport, send_later_cb, NULL, gc);
+		connect_info = gaim_proxy_connect(sip->account, sip->realhostname, sip->realport, send_later_cb, gc);
 		if(connect_info == NULL) {
 			gaim_connection_error(gc, _("Couldn't create socket"));
 		}
@@ -1553,7 +1553,7 @@
 			sip->realhostname, sip->realport);
 	/* open tcp connection to the server */
 	connect_info = gaim_proxy_connect(sip->account, sip->realhostname,
-			sip->realport, login_cb, NULL, sip->gc);
+			sip->realport, login_cb, sip->gc);
 	if(connect_info == NULL) {
 		gaim_connection_error(sip->gc, _("Couldn't create socket"));
 	}
--- a/src/protocols/yahoo/yahoo.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Aug 14 04:43:38 2006 +0000
@@ -2348,7 +2348,7 @@
 	/* Now we have our cookies to login with.  I'll go get the milk. */
 	if (gaim_proxy_connect(account, "wcs2.msg.dcn.yahoo.com",
 			       gaim_account_get_int(account, "port", YAHOO_PAGER_PORT),
-			       yahoo_got_web_connected, NULL, gc) == NULL) {
+			       yahoo_got_web_connected, gc) == NULL) {
 		gaim_connection_error(gc, _("Connection problem"));
 		return;
 	}
@@ -2516,7 +2516,7 @@
 			      "Host: login.yahoo.com\r\n\r\n");
 	g_hash_table_destroy(hash);
 	yd->auth = g_string_free(url, FALSE);
-	if (gaim_proxy_connect(account, "login.yahoo.com", 80, yahoo_got_cookies, NULL, gc) == NULL) {
+	if (gaim_proxy_connect(account, "login.yahoo.com", 80, yahoo_got_cookies, gc) == NULL) {
 		gaim_connection_error(gc, _("Connection problem"));
 		return;
 	}
@@ -2618,7 +2618,7 @@
 		if (gaim_proxy_connect(account,
 		                       gaim_account_get_string(account, "serverjp",  YAHOOJP_PAGER_HOST),
 		                       gaim_account_get_int(account, "port", YAHOO_PAGER_PORT),
-		                       yahoo_got_connected, NULL, gc) == NULL)
+		                       yahoo_got_connected, gc) == NULL)
 		{
 			gaim_connection_error(gc, _("Connection problem"));
 			return;
@@ -2628,7 +2628,7 @@
 		if (gaim_proxy_connect(account,
 		                       gaim_account_get_string(account, "server",  YAHOO_PAGER_HOST),
 		                       gaim_account_get_int(account, "port", YAHOO_PAGER_PORT),
-		                       yahoo_got_connected, NULL, gc) == NULL)
+		                       yahoo_got_connected, gc) == NULL)
 		{
 			gaim_connection_error(gc, _("Connection problem"));
 			return;
--- a/src/protocols/yahoo/yahoo_filexfer.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/yahoo/yahoo_filexfer.c	Mon Aug 14 04:43:38 2006 +0000
@@ -263,7 +263,7 @@
 		if (yd->jp) {
 			if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host",  YAHOOJP_XFER_HOST),
 			                       gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
-			                       yahoo_sendfile_connected, NULL, xfer) == NULL)
+			                       yahoo_sendfile_connected, xfer) == NULL)
 			{
 				gaim_notify_error(gc, NULL, _("File Transfer Failed"),
 				                _("Unable to establish file descriptor."));
@@ -272,7 +272,7 @@
 		} else {
 			if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host",  YAHOO_XFER_HOST),
 			                       gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
-			                       yahoo_sendfile_connected, NULL, xfer) == NULL)
+			                       yahoo_sendfile_connected, xfer) == NULL)
 			{
 				gaim_notify_error(gc, NULL, _("File Transfer Failed"),
 				                _("Unable to establish file descriptor."));
@@ -282,7 +282,7 @@
 	} else {
 		/* TODO: Using xfer->fd like this is probably a bad thing... */
 		if (gaim_proxy_connect(account, xfer_data->host, xfer_data->port,
-		                              yahoo_receivefile_connected, NULL, xfer) == NULL)
+		                              yahoo_receivefile_connected, xfer) == NULL)
 			xfer->fd = -1;
 		else
 			xfer->fd = 0;
--- a/src/protocols/yahoo/yahoo_picture.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/yahoo/yahoo_picture.c	Mon Aug 14 04:43:38 2006 +0000
@@ -484,7 +484,7 @@
 	if (yd->jp) {
 		if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host",  YAHOOJP_XFER_HOST),
 		                       gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
-		                       yahoo_buddy_icon_upload_connected, NULL, d) == NULL)
+		                       yahoo_buddy_icon_upload_connected, d) == NULL)
 		{
 			gaim_debug_error("yahoo", "Uploading our buddy icon failed to connect.\n");
 			yahoo_buddy_icon_upload_data_free(d);
@@ -492,7 +492,7 @@
 	} else {
 		if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host",  YAHOO_XFER_HOST),
 		                       gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
-		                       yahoo_buddy_icon_upload_connected, NULL, d) == NULL)
+		                       yahoo_buddy_icon_upload_connected, d) == NULL)
 		{
 			gaim_debug_error("yahoo", "Uploading our buddy icon failed to connect.\n");
 			yahoo_buddy_icon_upload_data_free(d);
--- a/src/protocols/yahoo/yahoochat.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/yahoo/yahoochat.c	Mon Aug 14 04:43:38 2006 +0000
@@ -1450,7 +1450,7 @@
 	gaim_roomlist_set_fields(rl, fields);
 
 	if (gaim_proxy_connect(gaim_connection_get_account(gc), yrl->host, 80,
-	                       yahoo_roomlist_got_connected, NULL, yrl) == NULL)
+	                       yahoo_roomlist_got_connected, yrl) == NULL)
 	{
 		gaim_notify_error(gc, NULL, _("Connection problem"), _("Unable to fetch room list."));
 		yahoo_roomlist_cleanup(rl, yrl);
@@ -1519,7 +1519,7 @@
 	gaim_roomlist_room_add(list, yrl->ucat);
 
 	if (gaim_proxy_connect(list->account, yrl->host, 80,
-	                       yahoo_roomlist_got_connected, NULL, yrl) == NULL)
+	                       yahoo_roomlist_got_connected, yrl) == NULL)
 	{
 		gaim_notify_error(gaim_account_get_connection(list->account),
 		                  NULL, _("Connection problem"), _("Unable to fetch room list."));
--- a/src/protocols/yahoo/ycht.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/protocols/yahoo/ycht.c	Mon Aug 14 04:43:38 2006 +0000
@@ -571,7 +571,7 @@
 	if (gaim_proxy_connect(account,
 	                       gaim_account_get_string(account, "ycht-server",  YAHOO_YCHT_HOST),
 	                       gaim_account_get_int(account, "ycht-port", YAHOO_YCHT_PORT),
-	                       ycht_got_connected, NULL, ycht) == NULL)
+	                       ycht_got_connected, ycht) == NULL)
 	{
 		ycht_connection_error(ycht, _("Connection problem"));
 		return;
--- a/src/proxy.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/proxy.c	Mon Aug 14 04:43:38 2006 +0000
@@ -40,7 +40,6 @@
 
 struct _GaimProxyConnectInfo {
 	GaimProxyConnectFunction connect_cb;
-	GaimProxyErrorFunction error_cb;
 	gpointer data;
 	char *host;
 	int port;
@@ -324,7 +323,7 @@
 static void
 gaim_proxy_connect_info_connected(GaimProxyConnectInfo *connect_info)
 {
-	connect_info->connect_cb(connect_info->data, connect_info->fd);
+	connect_info->connect_cb(connect_info->data, connect_info->fd, NULL);
 
 	/*
 	 * We've passed the file descriptor to the protocol, so it's no longer
@@ -348,22 +347,7 @@
 static void
 gaim_proxy_connect_info_error(GaimProxyConnectInfo *connect_info, const gchar *error_message)
 {
-	if (connect_info->error_cb == NULL)
-	{
-		/*
-		 * TODO
-		 * While we're transitioning to the new gaim_proxy_connect()
-		 * code, not all callers supply an error_cb.  If this is the
-		 * case then they're expecting connect_cb to be called with
-		 * an fd of -1 in the case of an error.  Once all callers have
-		 * been changed this whole if statement should be removed.
-		 */
-		connect_info->connect_cb(connect_info->data, -1);
-		gaim_proxy_connect_info_destroy(connect_info);
-		return;
-	}
-
-	connect_info->error_cb(connect_info->data, error_message);
+	connect_info->connect_cb(connect_info->data, -1, error_message);
 	gaim_proxy_connect_info_destroy(connect_info);
 }
 
@@ -2339,8 +2323,7 @@
 
 GaimProxyConnectInfo *
 gaim_proxy_connect(GaimAccount *account, const char *host, int port,
-				   GaimProxyConnectFunction connect_cb,
-				   GaimProxyErrorFunction error_cb, gpointer data)
+				   GaimProxyConnectFunction connect_cb, gpointer data)
 {
 	const char *connecthost = host;
 	int connectport = port;
@@ -2349,12 +2332,10 @@
 	g_return_val_if_fail(host       != NULL, NULL);
 	g_return_val_if_fail(port       >  0,    NULL);
 	g_return_val_if_fail(connect_cb != NULL, NULL);
-	/* g_return_val_if_fail(error_cb   != NULL, NULL); *//* TODO: Soon! */
 
 	connect_info = g_new0(GaimProxyConnectInfo, 1);
 	connect_info->fd = -1;
 	connect_info->connect_cb = connect_cb;
-	connect_info->error_cb = error_cb;
 	connect_info->data = data;
 	connect_info->host = g_strdup(host);
 	connect_info->port = port;
@@ -2404,20 +2385,17 @@
  */
 GaimProxyConnectInfo *
 gaim_proxy_connect_socks5(GaimProxyInfo *gpi, const char *host, int port,
-				   GaimProxyConnectFunction connect_cb,
-				   GaimProxyErrorFunction error_cb, gpointer data)
+				   GaimProxyConnectFunction connect_cb, gpointer data)
 {
 	GaimProxyConnectInfo *connect_info;
 
 	g_return_val_if_fail(host       != NULL, NULL);
 	g_return_val_if_fail(port       >  0,    NULL);
 	g_return_val_if_fail(connect_cb != NULL, NULL);
-	/* g_return_val_if_fail(error_cb   != NULL, NULL); *//* TODO: Soon! */
 
 	connect_info = g_new0(GaimProxyConnectInfo, 1);
 	connect_info->fd = -1;
 	connect_info->connect_cb = connect_cb;
-	connect_info->error_cb = error_cb;
 	connect_info->data = data;
 	connect_info->host = g_strdup(host);
 	connect_info->port = port;
--- a/src/proxy.h	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/proxy.h	Mon Aug 14 04:43:38 2006 +0000
@@ -58,8 +58,7 @@
 
 typedef struct _GaimProxyConnectInfo GaimProxyConnectInfo;
 
-typedef void (*GaimProxyConnectFunction)(gpointer data, gint source);
-typedef void (*GaimProxyErrorFunction)(gpointer dat, const gchar *error_message);
+typedef void (*GaimProxyConnectFunction)(gpointer data, gint source, const gchar *error_message);
 
 /**
  * The "hosts" parameter is a linked list containing pairs of
@@ -235,9 +234,9 @@
  * @param host       The destination host.
  * @param port       The destination port.
  * @param connect_cb The function to call when the connection is
- *                   established.
- * @param error_cb   The function to call if there is an error while
- *                   establishing the connection.
+ *                   established.  If the connection failed then
+ *                   fd will be -1 and error message will be set
+ *                   to something descriptive (hopefully).
  * @param data       User-defined data.
  *
  * @return NULL if there was an error, or a reference to a data
@@ -246,8 +245,7 @@
  */
 GaimProxyConnectInfo *gaim_proxy_connect(GaimAccount *account,
 			const char *host, int port,
-			GaimProxyConnectFunction connect_cb,
-			GaimProxyErrorFunction error_cb, gpointer data);
+			GaimProxyConnectFunction connect_cb, gpointer data);
 
 /**
  * Makes a connection through a SOCKS5 proxy.
@@ -256,9 +254,9 @@
  * @param host       The destination host.
  * @param port       The destination port.
  * @param connect_cb The function to call when the connection is
- *                   established.
- * @param error_cb   The function to call if there is an error while
- *                   establishing the connection.
+ *                   established.  If the connection failed then
+ *                   fd will be -1 and error message will be set
+ *                   to something descriptive (hopefully).
  * @param data       User-defined data.
  *
  * @return NULL if there was an error, or a reference to a data
@@ -267,8 +265,7 @@
  */
 GaimProxyConnectInfo *gaim_proxy_connect_socks5(GaimProxyInfo *gpi,
 			const char *host, int port,
-			GaimProxyConnectFunction connect_cb,
-			GaimProxyErrorFunction error_cb, gpointer data);
+			GaimProxyConnectFunction connect_cb, gpointer data);
 
 /**
  * Cancel an in-progress connection attempt.  This should be called
--- a/src/sslconn.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/sslconn.c	Mon Aug 14 04:43:38 2006 +0000
@@ -95,7 +95,7 @@
 	gsc->connect_cb      = func;
 	gsc->error_cb        = error_func;
 
-	connect_info = gaim_proxy_connect(account, host, port, ops->connect_cb, NULL, gsc);
+	connect_info = gaim_proxy_connect(account, host, port, ops->connect_cb, gsc);
 
 	if (connect_info == NULL)
 	{
--- a/src/upnp.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/upnp.c	Mon Aug 14 04:43:38 2006 +0000
@@ -811,7 +811,7 @@
 	}
 
 	if(gaim_proxy_connect(NULL, addressOfControl, port,
-			looked_up_internal_ip_cb, NULL, NULL) == NULL)
+			looked_up_internal_ip_cb, NULL) == NULL)
 	{
 		gaim_debug_error("upnp", "Get Local IP Connect Failed: Address: %s @@@ Port %d\n",
 			addressOfControl, port);
--- a/src/util.c	Mon Aug 14 02:16:58 2006 +0000
+++ b/src/util.c	Mon Aug 14 04:43:38 2006 +0000
@@ -3448,7 +3448,7 @@
 				   &gfud->website.page, &gfud->website.user, &gfud->website.passwd);
 
 	if (gaim_proxy_connect(NULL, gfud->website.address,
-		gfud->website.port, url_fetch_connect_cb, NULL, gfud) == NULL)
+		gfud->website.port, url_fetch_connect_cb, gfud) == NULL)
 	{
 		destroy_fetch_url_data(gfud);