libpurple/protocols/msn/servconn.c

changeset 24667
ea4a31429bbd
parent 24663
13f53cd06a48
child 24668
853a6d533d60
--- a/libpurple/protocols/msn/servconn.c	Sat Nov 15 07:43:48 2008 +0000
+++ b/libpurple/protocols/msn/servconn.c	Sat Nov 15 09:44:05 2008 +0000
@@ -375,15 +375,14 @@
 	servconn = data;
 	session = servconn->session;
 
-	len = read(servconn->fd, buf, sizeof(buf) - 1);
 	if (servconn->type == MSN_SERVCONN_NS)
-		servconn->session->account->gc->last_received = time(NULL);
+		session->account->gc->last_received = time(NULL);
 
-	if (len < 0 && errno == EAGAIN) {
+	len = read(servconn->fd, buf, sizeof(buf) - 1);
+	if (len < 0 && errno == EAGAIN)
 		return;
-
-	} else if (len <= 0) {
-		purple_debug_error("msn", "servconn %03d read error,"
+	if (len <= 0) {
+		purple_debug_error("msn", "servconn %03d read error, "
 			"len: %" G_GSSIZE_FORMAT ", errno: %d, error: %s\n",
 			servconn->num, len, errno, g_strerror(errno));
 		msn_servconn_got_error(servconn, MSN_SERVCONN_ERROR_READ);

mercurial