diff src/protocols/jabber/jabber.c @ 4366:7ba9b56a8796

[gaim-migrate @ 4632] Ok, so this is a patch by Nicolas Lichtmaier (niqueco). You've probably noticed that when you try to sign an account on, the UI freezes for a while (esp. on poor connections). This was because gethostbyname() blocks. Nicolas's patch here forks a new process to resolve host names and returns them in a pipe. It makes things smoother and faster. Thanks so much, Nicolas. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 20 Jan 2003 19:26:56 +0000
parents 5fb47ec9bfe4
children 83260179de90
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Mon Jan 20 18:12:14 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Jan 20 19:26:56 2003 +0000
@@ -765,8 +765,7 @@
 	jd = gc->proto_data;
 	gjc = jd->gjc;
 
-	if (gjc->fd != source)
-		gjc->fd = source;
+	gjc->fd = source;
 
 	if (source == -1) {
 		STATE_EVT(JCONN_STATE_OFF)
@@ -798,7 +797,7 @@
 static void gjab_start(gjconn gjc)
 {
 	struct aim_user *user;
-	int port;
+	int port, rc;
 
 	if (!gjc || gjc->state != JCONN_STATE_OFF)
 		return;
@@ -811,8 +810,8 @@
 	XML_SetElementHandler(gjc->parser, startElement, endElement);
 	XML_SetCharacterDataHandler(gjc->parser, charData);
 
-	gjc->fd = proxy_connect(gjc->user->server, port, gjab_connected, GJ_GC(gjc));
-	if (!user->gc || (gjc->fd < 0)) {
+	rc = proxy_connect(gjc->user->server, port, gjab_connected, GJ_GC(gjc));
+	if (!user->gc || (rc < 0)) {
 		STATE_EVT(JCONN_STATE_OFF)
 		return;
 	}