# HG changeset patch # User Elliott Sales de Andrade # Date 1318722194 0 # Node ID 845885bd5e4d70889c0db8b42886cc34de680f4e # Parent 13b5d6eb099d1c2b39b47ccff898c5fc2da83b2c 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. diff -r 13b5d6eb099d -r 845885bd5e4d libpurple/protocols/msn/slp.c --- 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; diff -r 13b5d6eb099d -r 845885bd5e4d libpurple/protocols/msn/xfer.c --- 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; diff -r 13b5d6eb099d -r 845885bd5e4d libpurple/protocols/msn/xfer.h --- 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;