diff src/protocols/oscar/rxqueue.c @ 2808:e79f30457998

[gaim-migrate @ 2821] plug it in, plug it in committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 28 Nov 2001 05:30:13 +0000
parents e841b14b5b89
children 10a2d4d5bcf2
line wrap: on
line diff
--- a/src/protocols/oscar/rxqueue.c	Tue Nov 27 23:55:50 2001 +0000
+++ b/src/protocols/oscar/rxqueue.c	Wed Nov 28 05:30:13 2001 +0000
@@ -24,10 +24,10 @@
 		int ret;
 		
 		ret = recv(fd, ((unsigned char *)buf)+cur, left, 0);
-		if (ret == -1)
+
+		/* Of course EOF is an error, only morons disagree with that. */
+		if (ret <= 0)
 			return -1;
-		else if (ret == 0)
-			return cur;
 
 		cur += ret;
 		left -= ret;
@@ -396,7 +396,11 @@
 	 * or we break.  We must handle it just in case.
 	 */
 	if (aimbs_get8(&flaphdr) != 0x2a) {
-		faimdprintf(sess, 0, "FLAP framing disrupted");
+		fu8_t start;
+
+		aim_bstream_rewind(&flaphdr);
+		start = aimbs_get8(&flaphdr);
+		faimdprintf(sess, 0, "FLAP framing disrupted (0x%02x)", start);
 		aim_conn_close(conn);
 		return -1;
 	}