# HG changeset patch # User Mark Doliner # Date 1155543806 0 # Node ID 87ff682bdf5f676b72af45407b97d09504e369f8 # Parent ae1c155bed575ab5803c247026d3761fe741bfeb [gaim-migrate @ 16752] I don't feel like fixing simple right now, so I'm adding some GAIM_CONNECTION_IS_VALID's to tide us over committer: Tailor Script diff -r ae1c155bed57 -r 87ff682bdf5f src/protocols/simple/simple.c --- a/src/protocols/simple/simple.c Mon Aug 14 08:22:39 2006 +0000 +++ b/src/protocols/simple/simple.c Mon Aug 14 08:23:26 2006 +0000 @@ -421,16 +421,24 @@ static void simple_input_cb(gpointer data, gint source, GaimInputCondition cond); -static void send_later_cb(gpointer data, gint source) { +static void send_later_cb(gpointer data, gint source, const gchar *error) { GaimConnection *gc = data; - struct simple_account_data *sip = gc->proto_data; + struct simple_account_data *sip; struct sip_connection *conn; + if (!GAIM_CONNECTION_IS_VALID(gc)) + { + if (source >= 0) + close(source); + return; + } + if(source < 0) { gaim_connection_error(gc, _("Could not connect")); return; } + sip = gc->proto_data; sip->fd = source; sip->connecting = FALSE; @@ -1453,16 +1461,24 @@ conn->inputhandler = gaim_input_add(newfd, GAIM_INPUT_READ, simple_input_cb, gc); } -static void login_cb(gpointer data, gint source) { +static void login_cb(gpointer data, gint source, const gchar *error_message) { GaimConnection *gc = data; - struct simple_account_data *sip = gc->proto_data; + struct simple_account_data *sip; struct sip_connection *conn; + if (!GAIM_CONNECTION_IS_VALID(gc)) + { + if (source >= 0) + close(source); + return; + } + if(source < 0) { gaim_connection_error(gc, _("Could not connect")); return; } + sip = gc->proto_data; sip->fd = source; conn = connection_create(sip, source);