# HG changeset patch # User Mark Doliner # Date 1155541031 0 # Node ID 12be86c7e2ceb60311318578468123b15739b5c8 # Parent 8ea1929c4c69d0717afe187cdc46b6126c243c25 [gaim-migrate @ 16750] Sametime should be good committer: Tailor Script diff -r 8ea1929c4c69 -r 12be86c7e2ce src/protocols/sametime/sametime.c --- a/src/protocols/sametime/sametime.c Mon Aug 14 07:27:41 2006 +0000 +++ b/src/protocols/sametime/sametime.c Mon Aug 14 07:37:11 2006 +0000 @@ -226,6 +226,7 @@ /** socket fd */ int socket; gint outpa; /* like inpa, but the other way */ + GaimProxyConnectInfo *connect_info; /** circular buffer for outgoing data */ GaimCircBuffer *sock_buf; @@ -310,7 +311,7 @@ /* connection functions */ -static void connect_cb(gpointer data, gint source); +static void connect_cb(gpointer data, gint source, const gchar *error_message); /* ----- session ------ */ @@ -1669,15 +1670,12 @@ /** Callback passed to gaim_proxy_connect when an account is logged in, and if the session logging in receives a redirect message */ -static void connect_cb(gpointer data, gint source) { +static void connect_cb(gpointer data, gint source, const gchar *error_message) { struct mwGaimPluginData *pd = data; GaimConnection *gc = pd->gc; - if(! g_list_find(gaim_connections_get_all(), pd->gc)) { - close(source); - g_return_if_reached(); - } + pd->connect_info = NULL; if(source < 0) { /* connection failed */ @@ -3683,7 +3681,8 @@ gaim_connection_update_progress(gc, _("Connecting"), 1, MW_CONNECT_STEPS); - if(gaim_proxy_connect(account, host, port, connect_cb, pd) == NULL) { + pd->connect_info = gaim_proxy_connect(account, host, port, connect_cb, pd); + if(pd->connect_info == NULL) { gaim_connection_error(gc, _("Unable to connect to host")); } } @@ -3716,6 +3715,11 @@ gc->inpa = 0; } + if(pd->connect_info != NULL) { + gaim_proxy_connect_cancel(pd->connect_info); + pd->connect_info = NULL; + } + /* clean up the rest */ mwGaimPluginData_free(pd); }