changeset 30473:56871d6c06fc

I've seen packet sizes larger than our current maximum. Hopefully 8KiB is big enough. Should probably test it out sometime.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Wed, 05 May 2010 08:18:35 +0000
parents 2caada025b1d
children 531fe008410e
files libpurple/protocols/msn/directconn.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/directconn.c	Wed May 05 08:14:40 2010 +0000
+++ b/libpurple/protocols/msn/directconn.c	Wed May 05 08:18:35 2010 +0000
@@ -43,7 +43,7 @@
 #pragma pack(pop)
 
 #define DC_PACKET_HEADER_SIZE sizeof(MsnDcContext)
-#define DC_MAX_BODY_SIZE      1352
+#define DC_MAX_BODY_SIZE      8*1024
 #define DC_MAX_PACKET_SIZE    (DC_PACKET_HEADER_SIZE + DC_MAX_BODY_SIZE)
 
 static void
@@ -682,8 +682,7 @@
 
 	/* Wait for packet length */
 	while (dc->in_pos >= 4) {
-		packet_length = *((guint32*)dc->in_buffer);
-		packet_length = GUINT32_FROM_LE(packet_length);
+		packet_length = GUINT32_FROM_LE(*((guint32*)dc->in_buffer));
 
 		if (packet_length > DC_MAX_PACKET_SIZE) {
 			/* Oversized packet */