Mercurial > pidgin
changeset 30862:5ad928319db0
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.
author | masca@cpw.pidgin.im |
---|---|
date | Wed, 04 Aug 2010 04:30:03 +0000 |
parents | 4445ae4215b8 |
children | 16ab805406d1 |
files | libpurple/protocols/msn/slplink.c libpurple/protocols/msn/slpmsg_part.c |
diffstat | 2 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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); } }
--- 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) {