# HG changeset patch # User masca@cpw.pidgin.im # Date 1280896203 0 # Node ID 5ad928319db0c2d8ad220579874de04824c0f289 # Parent 4445ae4215b8ec1e4a3063a59a957ccc37e72c6f Use the SlpMessage header offset only instead of it and the one on the SlpMessage when sending it. This fixes sending big data which needs to be split in multiple messages. diff -r 4445ae4215b8 -r 5ad928319db0 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Mon Aug 02 20:36:02 2010 +0000 +++ b/libpurple/protocols/msn/slplink.c Wed Aug 04 04:30:03 2010 +0000 @@ -298,7 +298,7 @@ real_size = (slpmsg->flags == P2P_ACK) ? 0 : slpmsg->size; - if (slpmsg->offset < real_size) + if (slpmsg->header->offset < real_size) { if (slpmsg->slpcall && slpmsg->slpcall->xfer && purple_xfer_get_type(slpmsg->slpcall->xfer) == PURPLE_XFER_SEND && purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED) @@ -308,15 +308,14 @@ } else { - len = slpmsg->size - slpmsg->offset; + len = slpmsg->size - slpmsg->header->offset; if (len > MSN_SBCONN_MAX_SIZE) len = MSN_SBCONN_MAX_SIZE; - msn_slpmsgpart_set_bin_data(part, slpmsg->buffer + slpmsg->offset, len); + msn_slpmsgpart_set_bin_data(part, slpmsg->buffer + slpmsg->header->offset, len); } - slpmsg->header->offset = slpmsg->offset; slpmsg->header->length = len; } @@ -343,7 +342,7 @@ if (slpmsg->slpcall->progress_cb != NULL) { slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size, - len, slpmsg->offset); + len, slpmsg->header->offset); } } diff -r 4445ae4215b8 -r 5ad928319db0 libpurple/protocols/msn/slpmsg_part.c --- a/libpurple/protocols/msn/slpmsg_part.c Mon Aug 02 20:36:02 2010 +0000 +++ b/libpurple/protocols/msn/slpmsg_part.c Wed Aug 04 04:30:03 2010 +0000 @@ -167,11 +167,11 @@ real_size = (slpmsg->flags == P2P_ACK) ? 0 : slpmsg->size; - slpmsg->offset += part->header->length; + slpmsg->header->offset += part->header->length; slpmsg->parts = g_list_remove(slpmsg->parts, part); - if (slpmsg->offset < real_size) + if (slpmsg->header->offset < real_size) { if (slpmsg->slpcall->xfer && purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED) {