diff src/protocols/yahoo/yahoo.c @ 9329:d42f3e4fd7ad

[gaim-migrate @ 10137] We were ignoring an extra packet the server is sending now on joining a room, which has extra members in it. This makes us process it. We do so one at a time though, so it prints a has joined message for them, which sucks but oh well. This also fixes a "bug" where we were getting confused and thinking keys were values and values were keys. But the reason we were getting confused is pretty weird. I think the server was intentionally trying to confuse us this way, to hide extra data from older clients. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 20 Jun 2004 19:18:42 +0000
parents f40233043b5a
children 241a799cc821
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Sun Jun 20 14:46:24 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sun Jun 20 19:18:42 2004 +0000
@@ -103,6 +103,20 @@
 
 		struct yahoo_pair *pair = g_new0(struct yahoo_pair, 1);
 
+		/* this is weird, and in one of the chat packets, and causes us
+		 * think all the values are keys and all the keys are values after
+		 * this point if we don't handle it */
+		if (data[pos] == '\0') {
+			while (pos + 1 < len) {
+				if (data[pos] == 0xc0 && data[pos + 1] == 0x80)
+					break;
+				pos++;
+			}
+			pos += 2;
+			g_free(pair);
+			continue;
+		}
+
 		x = 0;
 		while (pos + 1 < len) {
 			if (data[pos] == 0xc0 && data[pos + 1] == 0x80)
@@ -241,6 +255,8 @@
 
 	yahoo_packet_dump(data, len);
 	ret = write(yd->fd, data, len);
+	if (ret != len)
+		gaim_debug_warning("yahoo", "Only wrote %d of %d bytes!", ret, len);
 	g_free(data);
 
 	return ret;