soc.2010.msn-tlc: e4ced579: Use the SlpMessage header offset only in...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Thu Aug 5 22:01:18 EDT 2010


----------------------------------------------------------------------
Revision: e4ced57913d1bb22869ad3ff736de5b64dd63425
Parent:   bf7e29b2ecf213c264c20397026eb37d811e7432
Author:   masca at cpw.pidgin.im
Date:     08/04/10 00:30:03
Branch:   im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/e4ced57913d1bb22869ad3ff736de5b64dd63425

Changelog: 

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.

Changes against parent bf7e29b2ecf213c264c20397026eb37d811e7432

  patched  libpurple/protocols/msn/slplink.c
  patched  libpurple/protocols/msn/slpmsg_part.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slplink.c	266a7c55b33a686b0514d1473b37c2445925450c
+++ libpurple/protocols/msn/slplink.c	a752b08eba7dc5d71feb2454640ef443e6c22faa
@@ -298,7 +298,7 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
 
 	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 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
 		}
 		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 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
 		if (slpmsg->slpcall->progress_cb != NULL)
 		{
 			slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size,
-										 len, slpmsg->offset);
+										 len, slpmsg->header->offset);
 		}
 	}
 
============================================================
--- libpurple/protocols/msn/slpmsg_part.c	748c56f12fb875ec63c4809f4fb3045711e125e5
+++ libpurple/protocols/msn/slpmsg_part.c	b4cfa1967ef3406f75bd3fda2b4e5d9e801871fd
@@ -167,11 +167,11 @@ msn_slpmsgpart_ack(MsnSlpMessagePart *pa
 
 	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)
 		{


More information about the Commits mailing list