# HG changeset patch # User masca@cpw.pidgin.im # Date 1281045493 0 # Node ID 16ab805406d186b46ab0745c3325bfe32711a976 # Parent 5ad928319db0c2d8ad220579874de04824c0f289 Get rid of the offset field in the SlpMessage in favor of the one in the Header. diff -r 5ad928319db0 -r 16ab805406d1 libpurple/protocols/msn/p2p.h --- a/libpurple/protocols/msn/p2p.h Wed Aug 04 04:30:03 2010 +0000 +++ b/libpurple/protocols/msn/p2p.h Thu Aug 05 21:58:13 2010 +0000 @@ -6,6 +6,12 @@ typedef struct { guint32 session_id; guint32 id; + /** + * In a MsnSlpMessage: + * For outgoing messages this is the number of bytes from buffer that + * have already been sent out. For incoming messages this is the + * number of bytes that have been written to buffer. + */ guint64 offset; guint64 total_size; guint32 length; diff -r 5ad928319db0 -r 16ab805406d1 libpurple/protocols/msn/slpcall.c --- a/libpurple/protocols/msn/slpcall.c Wed Aug 04 04:30:03 2010 +0000 +++ b/libpurple/protocols/msn/slpcall.c Thu Aug 05 21:58:13 2010 +0000 @@ -1060,7 +1060,7 @@ slpcall = NULL; body = slpmsg->buffer; - body_len = slpmsg->offset; + body_len = slpmsg->header->offset; if (slpmsg->flags == P2P_NO_FLAG || slpmsg->flags == P2P_WML2009_COMP) { diff -r 5ad928319db0 -r 16ab805406d1 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Wed Aug 04 04:30:03 2010 +0000 +++ b/libpurple/protocols/msn/slplink.c Thu Aug 05 21:58:13 2010 +0000 @@ -578,14 +578,14 @@ else if (slpmsg->size && slpmsg->buffer) { if (G_MAXSIZE - part->size < part->header->offset || (part->header->offset + part->size) > slpmsg->size - || slpmsg->offset != part->header->offset) { + || slpmsg->header->offset != part->header->offset) { purple_debug_error("msn", "Oversized slpmsg - msgsize=%lld offset=%" G_GUINT64_FORMAT " len=%" G_GSIZE_FORMAT "\n", slpmsg->size, part->header->offset, part->size); g_return_if_reached(); } else { memcpy(slpmsg->buffer + part->header->offset, part->buffer, part->size); - slpmsg->offset += part->size; + slpmsg->header->offset += part->size; } } } diff -r 5ad928319db0 -r 16ab805406d1 libpurple/protocols/msn/slpmsg.h --- a/libpurple/protocols/msn/slpmsg.h Wed Aug 04 04:30:03 2010 +0000 +++ b/libpurple/protocols/msn/slpmsg.h Thu Aug 05 21:58:13 2010 +0000 @@ -61,13 +61,6 @@ guchar *buffer; /** - * For outgoing messages this is the number of bytes from buffer that - * have already been sent out. For incoming messages this is the - * number of bytes that have been written to buffer. - */ - long long offset; - - /** * This is the size of buffer, unless this is an outgoing file transfer, * in which case this is the size of the file. */