changeset 1566:e9faf5dfdba0

[gaim-migrate @ 1576] if not connected and disconnect remove WRITE instead of READ committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 13 Mar 2001 11:05:13 +0000
parents 2c66d386be90
children 0357164dffd0
files plugins/yay/conn.c plugins/yay/internal.h plugins/yay/rxhandlers.c
diffstat 3 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/yay/conn.c	Tue Mar 13 10:05:45 2001 +0000
+++ b/plugins/yay/conn.c	Tue Mar 13 11:05:13 2001 +0000
@@ -196,8 +196,12 @@
 	if (!g_list_find(session->connlist, conn))
 		return;
 
-	if (yahoo_socket_notify)
-		(*yahoo_socket_notify)(session, conn->socket, YAHOO_SOCKET_READ, FALSE);
+	if (yahoo_socket_notify) {
+		if (conn->connected)
+			(*yahoo_socket_notify)(session, conn->socket, YAHOO_SOCKET_READ, FALSE);
+		else
+			(*yahoo_socket_notify)(session, conn->socket, YAHOO_SOCKET_WRITE, FALSE);
+	}
 	close(conn->socket);
 
 	session->connlist = g_list_remove(session->connlist, conn);
--- a/plugins/yay/internal.h	Tue Mar 13 10:05:45 2001 +0000
+++ b/plugins/yay/internal.h	Tue Mar 13 11:05:13 2001 +0000
@@ -36,6 +36,7 @@
 	int type;
 	int socket;
 	int magic_id;
+	gboolean connected;
 	char *txqueue;
 };
 
--- a/plugins/yay/rxhandlers.c	Tue Mar 13 10:05:45 2001 +0000
+++ b/plugins/yay/rxhandlers.c	Tue Mar 13 11:05:13 2001 +0000
@@ -246,6 +246,7 @@
 
 		YAHOO_PRINT(session, YAHOO_LOG_NOTICE, "connected");
 
+		conn->connected = TRUE;
 		if (yahoo_socket_notify)
 			(*yahoo_socket_notify)(session, socket, YAHOO_SOCKET_WRITE, FALSE);
 		if (yahoo_socket_notify)