changeset 2688:98b1ac8ddea3

[gaim-migrate @ 2701] i don't care committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 07 Nov 2001 12:17:31 +0000
parents 2d544f48146d
children 870450d36999
files src/protocols/msn/msn.c src/protocols/yahoo/yahoo.c
diffstat 2 files changed, 24 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Wed Nov 07 11:14:33 2001 +0000
+++ b/src/protocols/msn/msn.c	Wed Nov 07 12:17:31 2001 +0000
@@ -954,11 +954,15 @@
 			port = 1863;
 
 		ms = g_new0(struct msn_switchboard, 1);
+		ms->fd = proxy_connect(ssaddr, port, msn_rng_connect, ms);
+		if (ms->fd < 0) {
+			g_free(ms);
+			return;
+		}
 		ms->user = g_strdup(user);
 		ms->sessid = g_strdup(sessid);
 		ms->auth = g_strdup(auth);
 		ms->gc = gc;
-		ms->fd = proxy_connect(ssaddr, port, msn_rng_connect, ms);
 	} else if (!g_strncasecmp(buf, "SYN", 3)) {
 	} else if (!g_strncasecmp(buf, "USR", 3)) {
 	} else if (!g_strncasecmp(buf, "XFR", 3)) {
@@ -999,13 +1003,21 @@
 
 			GET_NEXT(tmp);
 
+			ms->fd = proxy_connect(host, port, msn_ss_xfr_connect, ms);
+			if (ms->fd < 0) {
+				msn_kill_switch(ms);
+				return;
+			}
 			ms->auth = g_strdup(tmp);
-			ms->fd = proxy_connect(host, port, msn_ss_xfr_connect, ms);
 		} else {
 			close(md->fd);
 			gaim_input_remove(md->inpa);
 			md->inpa = 0;
 			md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc);
+			if (md->fd < 0) {
+				hide_login_progress(gc, "Error transfering");
+				signoff(gc);
+			}
 		}
 	} else if (isdigit(*buf)) {
 		handle_errcode(buf, TRUE);
@@ -1173,6 +1185,10 @@
 		md->inpa = 0;
 		md->fd = 0;
 		md->fd = proxy_connect(host, port, msn_login_xfr_connect, gc);
+		if (md->fd < 0) {
+			hide_login_progress(gc, "Unable to transfer");
+			signoff(gc);
+		}
 	} else {
 		if (isdigit(*buf))
 			hide_login_progress(gc, handle_errcode(buf, FALSE));
@@ -1226,6 +1242,10 @@
 	g_snprintf(gc->username, sizeof(gc->username), "%s", msn_normalize(gc->username));
 
 	md->fd = proxy_connect("messenger.hotmail.com", 1863, msn_login_connect, gc);
+	if (md->fd < 0) {
+		hide_login_progress(gc, "Unable to connect");
+		signoff(gc);
+	}
 }
 
 static void msn_close(struct gaim_connection *gc)
--- a/src/protocols/yahoo/yahoo.c	Wed Nov 07 11:14:33 2001 +0000
+++ b/src/protocols/yahoo/yahoo.c	Wed Nov 07 12:17:31 2001 +0000
@@ -740,11 +740,11 @@
 	yd->fd = -1;
 	yd->hash = g_hash_table_new(g_str_hash, g_str_equal);
 
-	if (!proxy_connect(user->proto_opt[USEROPT_PAGERHOST][0] ?
+	if (proxy_connect(user->proto_opt[USEROPT_PAGERHOST][0] ?
 				user->proto_opt[USEROPT_PAGERHOST] : YAHOO_PAGER_HOST,
 			   user->proto_opt[USEROPT_PAGERPORT][0] ?
 				atoi(user->proto_opt[USEROPT_PAGERPORT]) : YAHOO_PAGER_PORT,
-			   yahoo_got_connected, gc)) {
+			   yahoo_got_connected, gc) < 0) {
 		hide_login_progress(gc, "Connection problem");
 		signoff(gc);
 		return;