changeset 2800:0ad63a625eec

[gaim-migrate @ 2813] hm committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 27 Nov 2001 09:57:48 +0000
parents 72357bddb0f3
children 04f97d65bdc1
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Tue Nov 27 03:30:41 2001 +0000
+++ b/src/protocols/jabber/jabber.c	Tue Nov 27 09:57:48 2001 +0000
@@ -126,6 +126,7 @@
 	GSList *existing_chats;
 	GHashTable *hash;
 	time_t idle;
+	gboolean die;
 };
 
 struct jabber_chat {
@@ -332,9 +333,12 @@
 		return;
 
 	if ((len = read(j->fd, buf, sizeof(buf) - 1))) {
+		struct jabber_data *jd = GJ_GC(j)->proto_data;
 		buf[len] = '\0';
 		debug_printf("input (len %d): %s\n", len, buf);
 		XML_Parse(j->parser, buf, len, 0);
+		if (jd->die)
+			signoff(GJ_GC(j));
 	} else if (len <= 0) {
 		STATE_EVT(JCONN_STATE_OFF)
 	}
@@ -983,6 +987,7 @@
 		xmlnode xerr;
 		char *errmsg = NULL;
 		int errcode = 0;
+		struct jabber_data *jd = GJ_GC(j)->proto_data;
 
 		debug_printf("auth failed\n");
 		xerr = xmlnode_get_tag(p->x, "error");
@@ -999,7 +1004,7 @@
 			hide_login_progress(GJ_GC(j), "Unknown login error");
 		}
 
-		signoff(GJ_GC(j));
+		jd->die = TRUE;
 	}
 }