changeset 29495:f8a95fdab3bd

Fix FT context header length handling. The official client only seems to care about this value if the version is 3.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 28 Feb 2010 04:06:46 +0000
parents 1a9977557dc9
children a0adf0bb19b7 6d3a90b49dba
files libpurple/protocols/msn/slp.c libpurple/protocols/msn/slplink.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Sun Feb 28 02:11:57 2010 +0000
+++ b/libpurple/protocols/msn/slp.c	Sun Feb 28 04:06:46 2010 +0000
@@ -397,8 +397,8 @@
 
 		header = (MsnFileContext *)purple_base64_decode(context, &bin_len);
 		if (bin_len >= sizeof(MsnFileContext) - 1 &&
-		    header->length == sizeof(MsnFileContext) - 1 &&
-		    header->version == 2) {
+			(header->version == 2 ||
+			 (header->version == 3 && header->length == sizeof(MsnFileContext) + 63))) {
 			file_size = GUINT64_FROM_LE(header->file_size);
 
 			file_name = g_convert((const gchar *)&header->file_name,
--- a/libpurple/protocols/msn/slplink.c	Sun Feb 28 02:11:57 2010 +0000
+++ b/libpurple/protocols/msn/slplink.c	Sun Feb 28 04:06:46 2010 +0000
@@ -686,7 +686,7 @@
 		u8 = NULL;
 	}
 
-	header.length = GUINT32_TO_LE(sizeof(MsnFileContext));
+	header.length = GUINT32_TO_LE(sizeof(MsnFileContext) - 1);
 	header.version = GUINT32_TO_LE(2); /* V.3 contains additional unnecessary data */
 	header.file_size = GUINT64_TO_LE(size);
 	header.type = GUINT32_TO_LE(1);    /* No file preview */