# HG changeset patch # User Nathan Walp # Date 1057863412 0 # Node ID 8d6aa792e0f68edd7ad234f5c754bebabf349e90 # Parent f7ddc1f6227e37c8c93c1538b8b3559551742e58 [gaim-migrate @ 6535] make the jabber error code, and the core error code more betterer. this should fix luke's problem with downed jabber servers committer: Tailor Script diff -r f7ddc1f6227e -r 8d6aa792e0f6 src/connection.c --- a/src/connection.c Thu Jul 10 06:55:23 2003 +0000 +++ b/src/connection.c Thu Jul 10 18:56:52 2003 +0000 @@ -175,9 +175,11 @@ gboolean gaim_connection_disconnect_cb(gpointer data) { - GaimConnection *gc = data; + GaimAccount *account = data; + GaimConnection *gc = gaim_account_get_connection(account); - gaim_connection_disconnect(gc); + if(gc) + gaim_connection_disconnect(gc); return FALSE; } @@ -371,7 +373,8 @@ if (ops != NULL && ops->disconnected != NULL) ops->disconnected(gc, text); - g_timeout_add(0, gaim_connection_disconnect_cb, gc); + g_timeout_add(0, gaim_connection_disconnect_cb, + gaim_connection_get_account(gc)); } void diff -r f7ddc1f6227e -r 8d6aa792e0f6 src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Thu Jul 10 06:55:23 2003 +0000 +++ b/src/protocols/jabber/jabber.c Thu Jul 10 18:56:52 2003 +0000 @@ -551,13 +551,17 @@ { if (gjc && gjc->state != JCONN_STATE_OFF) { char *buf = xmlnode2str(x); - if (buf) + if (buf) { #ifndef _WIN32 - write(gjc->fd, buf, strlen(buf)); + if(write(gjc->fd, buf, strlen(buf)) < 0) { #else - send(gjc->fd, buf, strlen(buf), 0); + if(send(gjc->fd, buf, strlen(buf), 0) < 0) { #endif - gaim_debug(GAIM_DEBUG_MISC, "jabber", "gjab_send: %s\n", buf); + gaim_connection_error(GJ_GC(gjc), _("Write error")); + } else { + gaim_debug(GAIM_DEBUG_MISC, "jabber", "gjab_send: %s\n", buf); + } + } } } @@ -572,8 +576,7 @@ #else if(send(gjc->fd, str, strlen(str), 0) < 0) { #endif - fprintf(stderr, "DBG: Problem sending. Error: %d\n", errno); - fflush(stderr); + gaim_connection_error(GJ_GC(gjc), _("Write error")); } /* printing keepalives to the debug window is really annoying */ if(strcmp(str, JABBER_KEEPALIVE_STRING))