diff src/protocols/jabber/jabber.c @ 6076:8d6aa792e0f6

[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 <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 10 Jul 2003 18:56:52 +0000
parents d8cd876e613e
children 99f4bbeb27bc
line wrap: on
line diff
--- 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))