changeset 32286:845885bd5e4d

Since we don't know what these fields are, and we don't use them, there's probably no need to waste memory for them.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 15 Oct 2011 23:43:14 +0000
parents 13b5d6eb099d
children b2b704d658da
files libpurple/protocols/msn/slp.c libpurple/protocols/msn/xfer.c libpurple/protocols/msn/xfer.h
diffstat 3 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/slp.c	Sat Oct 15 23:33:31 2011 +0000
+++ b/libpurple/protocols/msn/slp.c	Sat Oct 15 23:43:14 2011 +0000
@@ -336,8 +336,10 @@
 	}
 	memset(&context.file_name[currentChar], 0x00, (MAX_FILE_NAME_LEN - currentChar) * 2);
 
+#if 0
 	memset(&context.unknown1, 0, sizeof(context.unknown1));
 	context.unknown2 = 0xffffffff;
+#endif
 
 	/* Mind the cast, as in, don't free it after! */
 	context.preview = (char *)preview;
--- a/libpurple/protocols/msn/xfer.c	Sat Oct 15 23:33:31 2011 +0000
+++ b/libpurple/protocols/msn/xfer.c	Sat Oct 15 23:43:14 2011 +0000
@@ -174,9 +174,15 @@
 	msn_push32le(tmp, context->type);
 	memcpy(tmp, context->file_name, MAX_FILE_NAME_LEN * 2);
 	tmp += MAX_FILE_NAME_LEN * 2;
+#if 0
 	memcpy(tmp, context->unknown1, sizeof(context->unknown1));
 	tmp += sizeof(context->unknown1);
 	msn_push32le(tmp, context->unknown2);
+#else
+	memset(tmp, 0, sizeof(gchar[30]));
+	tmp += sizeof(gchar[30]);
+	msn_push32le(tmp, 0);
+#endif
 	if (context->preview) {
 		memcpy(tmp, context->preview, context->preview_len);
 	}
@@ -218,9 +224,13 @@
 	context->type = msn_pop32le(buf);
 	memcpy(context->file_name, buf, MAX_FILE_NAME_LEN * 2);
 	buf += MAX_FILE_NAME_LEN * 2;
+#if 0
 	memcpy(context->unknown1, buf, sizeof(context->unknown1));
 	buf += sizeof(context->unknown1);
 	context->unknown2 = msn_pop32le(buf);
+#else
+	buf += sizeof(gchar[30]) + sizeof(guint32);
+#endif
 
 	if (context->type == 0 && len > context->length) {
 		context->preview_len = len - context->length;
--- a/libpurple/protocols/msn/xfer.h	Sat Oct 15 23:33:31 2011 +0000
+++ b/libpurple/protocols/msn/xfer.h	Sat Oct 15 23:43:14 2011 +0000
@@ -39,8 +39,10 @@
 	guint64   file_size;    /*< Size of file */
 	guint32   type;         /*< Transfer type */
 	gunichar2 file_name[MAX_FILE_NAME_LEN]; /*< Self-explanatory */
+#if 0
 	gchar     unknown1[30]; /*< Used somehow for background sharing */
 	guint32   unknown2;     /*< Possibly for background sharing as well */
+#endif
 	gchar     *preview;     /*< File preview data, 96x96 PNG */
 	gsize     preview_len;
 } MsnFileContext;