pidgin: a0ec4b57: Since we don't know what these fields ar...

qulogic at pidgin.im qulogic at pidgin.im
Sat Oct 15 20:20:48 EDT 2011


----------------------------------------------------------------------
Revision: a0ec4b577c42b1047b959642f310ac053de4336b
Parent:   b3af80e2b2aa4f145cea5dc9f3ad1fb22f1d7536
Author:   qulogic at pidgin.im
Date:     10/15/11 19:43:14
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/a0ec4b577c42b1047b959642f310ac053de4336b

Changelog: 

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.

Changes against parent b3af80e2b2aa4f145cea5dc9f3ad1fb22f1d7536

  patched  libpurple/protocols/msn/slp.c
  patched  libpurple/protocols/msn/xfer.c
  patched  libpurple/protocols/msn/xfer.h

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slp.c	73429be67fba1fa283d9a02dfc56f4a4331ee135
+++ libpurple/protocols/msn/slp.c	bc016f95d82aa1a8efcf91c63aa8b91fed970a5a
@@ -336,8 +336,10 @@ gen_context(PurpleXfer *xfer, const char
 	}
 	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;
============================================================
--- libpurple/protocols/msn/xfer.c	9fa6df0648c8b8ac1e3ffe347da8aba971e76652
+++ libpurple/protocols/msn/xfer.c	db55914ca25b1a3ed3239b47146f668161850b9e
@@ -174,9 +174,15 @@ msn_file_context_to_wire(MsnFileContext 
 	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 @@ msn_file_context_from_wire(const char *b
 	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;
============================================================
--- libpurple/protocols/msn/xfer.h	14c70992d37863a845ab03341f1dc88802ee33c5
+++ libpurple/protocols/msn/xfer.h	83dd5866b2a75890858f161033c01a696bf73e08
@@ -39,8 +39,10 @@ typedef struct
 	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;


More information about the Commits mailing list