# HG changeset patch # User Elliott Sales de Andrade # Date 1215578342 0 # Node ID 186af522f14db82aa6b0083050388c3e516ff9ad # Parent 7f4473544c64c8624d44721355fe004c1d74002e 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. diff -r 7f4473544c64 -r 186af522f14d libpurple/protocols/msn/servconn.c --- a/libpurple/protocols/msn/servconn.c Wed Jul 09 04:18:07 2008 +0000 +++ b/libpurple/protocols/msn/servconn.c Wed Jul 09 04:39:02 2008 +0000 @@ -393,21 +393,16 @@ len = read(servconn->fd, buf, sizeof(buf) - 1); servconn->session->account->gc->last_received = time(NULL); - if (len <= 0) { - switch (errno) { - - case 0: - - case EBADF: - case EAGAIN: return; + if (len < 0 && errno == 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; - } + } 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); + + return; } buf[len] = '\0';