diff src/protocols/msn/msn.c @ 4452:2afc0f845e74

[gaim-migrate @ 4727] I cleaned up the async dns stuff a bit. Now everything will work again. Even TOC. You don't want to use TOC, though--but you already know that. You're smart. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 28 Jan 2003 21:42:44 +0000
parents 5a7fda352a8d
children c7aae8902e5e
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Tue Jan 28 18:49:42 2003 +0000
+++ b/src/protocols/msn/msn.c	Tue Jan 28 21:42:44 2003 +0000
@@ -688,8 +688,7 @@
 	int cont = 1;
 	int len;
 
-	if (mft->fd != source)
-		mft->fd = source;
+	mft->fd = source;
 
 	len = read(mft->fd, buf, sizeof(buf));
 
@@ -838,9 +837,7 @@
 			mft->port = atoi(port_s);
 			mft->authcookie = atol(authcookie_s);
 
-			mft->fd = proxy_connect(mft->ip, mft->port, msn_msnftp_connect, mft);
-
-			if (ms->fd < 0) {
+			if (proxy_connect(mft->ip, mft->port, msn_msnftp_connect, mft) != 0) {
 				md->file_transfers = g_slist_remove(md->file_transfers, mft);
 				return;
 			}
@@ -933,9 +930,7 @@
 	int cont = 1;
 	int len;
 	
-	/* This is really stupid and I hate to put this here. */
-	if (ms->fd != source)
-		ms->fd = source;
+	ms->fd = source;
 	len = read(ms->fd, buf, sizeof(buf));
 	if (len <= 0) {
 		msn_kill_switch(ms);
@@ -1437,8 +1432,7 @@
 			port = 1863;
 
 		ms = g_new0(struct msn_switchboard, 1);
-		ms->fd = proxy_connect(ssaddr, port, msn_rng_connect, ms);
-		if (ms->fd < 0) {
+		if (proxy_connect(ssaddr, port, msn_rng_connect, ms) != 0) {
 			g_free(ms);
 			return 1;
 		}
@@ -1548,26 +1542,22 @@
 		}
 
 		if (switchboard) {
-			int rc;
 			struct msn_switchboard *ms = msn_find_writable_switch(gc);
 			if (!ms)
 				return 1;
 
 			GET_NEXT(tmp);
 
-			rc = proxy_connect(host, port, msn_ss_xfr_connect, ms);
-			if (rc < 0) {
+			if (proxy_connect(host, port, msn_ss_xfr_connect, ms) != 0) {
 				msn_kill_switch(ms);
 				return 1;
 			}
 			ms->auth = g_strdup(tmp);
 		} else {
-			int rc;
 			close(md->fd);
 			gaim_input_remove(md->inpa);
 			md->inpa = 0;
-			rc = proxy_connect(host, port, msn_login_xfr_connect, gc);
-			if (rc < 0) {
+			if (proxy_connect(host, port, msn_login_xfr_connect, gc) != 0) {
 				hide_login_progress(gc, _("Error transfering"));
 				signoff(gc);
 				return 0;
@@ -1862,9 +1852,8 @@
 		gaim_input_remove(md->inpa);
 		md->inpa = 0;
 		md->fd = 0;
-		md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc);
 		md->sl = time(NULL);
-		if (md->fd < 0) {
+		if (proxy_connect(host, port, msn_login_xfr_connect, gc) != 0) {
 			hide_login_progress(gc, _("Unable to transfer"));
 			signoff(gc);
 		}
@@ -1978,10 +1967,9 @@
 
 	g_snprintf(gc->username, sizeof(gc->username), "%s", msn_normalize(gc->username));
 	
-	md->fd = proxy_connect(user->proto_opt[USEROPT_MSNSERVER][0] ? user->proto_opt[USEROPT_MSNSERVER] : MSN_SERVER, 
+	if (proxy_connect(user->proto_opt[USEROPT_MSNSERVER][0] ? user->proto_opt[USEROPT_MSNSERVER] : MSN_SERVER, 
 			       user->proto_opt[USEROPT_MSNPORT][0] ? atoi(user->proto_opt[USEROPT_MSNPORT]) : MSN_PORT,
-			       msn_login_connect, gc);
-	if (md->fd < 0) {
+			       msn_login_connect, gc) != 0) {
 		hide_login_progress(gc, _("Unable to connect"));
 		signoff(gc);
 	}