cpw.qulogic.msn: e0c15c71: In MSN servconn, make handling of EAGAIN...

qulogic at pidgin.im qulogic at pidgin.im
Wed Jul 9 00:46:03 EDT 2008


-----------------------------------------------------------------
Revision: e0c15c710af77a687e1adb624fdf03917bfef2fe
Ancestor: 5f2d00798a4ceb0549cf17769fcaace186d9efa2
Author: qulogic at pidgin.im
Date: 2008-07-09T04:39:02
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/e0c15c710af77a687e1adb624fdf03917bfef2fe

Modified files:
        libpurple/protocols/msn/servconn.c

ChangeLog: 

In MSN servconn, make handling of EAGAIN similar to that in httpconn. 
Now it should report an error when the server blocks some text and then 
disconnects, instead of continuously trying to read something and 
seeming totally frozen.

Also, stopped checking for EBADF, since it's not checked in httpconn.c 
or soap.c. I hope that doesn't break anything.

References #6257.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/servconn.c	213ba8ae343386025233c6055f5cc29edc93b087
+++ libpurple/protocols/msn/servconn.c	0f97d21ee4c3fefa49f8ca979afce2a4b256c990
@@ -393,21 +393,16 @@ read_cb(gpointer data, gint source, Purp
 	len = read(servconn->fd, buf, sizeof(buf) - 1);
 	servconn->session->account->gc->last_received = time(NULL);
 
-	if (len <= 0) {
-		switch (errno) {
+	if (len < 0 && errno == EAGAIN) {
+		return;
 
-			case 0:
+	} else if (len <= 0) {
+		purple_debug_error("msn", "servconn read error,"
+		                          "len: %d, errno: %d, error: %s\n",
+		                          len, errno, g_strerror(errno));
+		msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ);
 
-			case EBADF:
-			case EAGAIN: return;
-
-			default: purple_debug_error("msn", "servconn read error,"
-						"len: %d, errno: %d, error: %s\n",
-						len, errno, g_strerror(errno));
-				 msn_servconn_got_error(servconn,
-						 MSN_SERVCONN_ERROR_READ);
-				 return;
-		}
+		return;
 	}
 
 	buf[len] = '\0';


More information about the Commits mailing list