soc.2010.msn-tlc: 482b1439: Document SlpMessage size limits.

masca at cpw.pidgin.im masca at cpw.pidgin.im
Wed Jun 16 19:15:58 EDT 2010


-----------------------------------------------------------------
Revision: 482b14391e896022cbd7f8150ac4423ab1b4317d
Ancestor: 42d97406a4966cdb5d0a74cce32b25d6c5c6482a
Author: masca at cpw.pidgin.im
Date: 2010-06-15T21:05:27
Branch: im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/482b14391e896022cbd7f8150ac4423ab1b4317d

Modified files:
        libpurple/protocols/msn/directconn.h
        libpurple/protocols/msn/sbconn.h
        libpurple/protocols/msn/slplink.c

ChangeLog: 

Document SlpMessage size limits.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.h	2be569768132f7eb1cb16d77bac44572341d06b2
+++ libpurple/protocols/msn/directconn.h	45f0333bb464cc48e28a5e62ae625a6796d5d06a
@@ -36,6 +36,8 @@ typedef struct _MsnDirectConn MsnDirectC
 #include "slpmsg.h"
 #include "p2p.h"
 
+#define MSN_DCCONN_MAX_SIZE 1352
+
 typedef enum
 {
 	DC_STATE_CLOSED,            /*< No socket opened yet */
============================================================
--- libpurple/protocols/msn/sbconn.h	a4decb4c77b646fe7f124d8fbbbdff4a47585240
+++ libpurple/protocols/msn/sbconn.h	14610611c08cd31033babab9f077b3a59179a023
@@ -3,6 +3,8 @@
 
 #include "msg.h"
 
+#define MSN_SBCONN_MAX_SIZE 1202
+
 void msn_sbconn_msg_ack(MsnMessage *msg, void *data);
 
 void msn_sbconn_msg_nak(MsnMessage *msg, void *data);
============================================================
--- libpurple/protocols/msn/slplink.c	f75fe3889ed7bd059248b13e33a93cc5b65ccdf2
+++ libpurple/protocols/msn/slplink.c	a3df971cf7ea2e35d82d29113caae165f8faf59b
@@ -307,15 +307,15 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
 		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)
 		{
-			len = MIN(1202, slpmsg->slpcall->u.outgoing.len);
+			len = MIN(MSN_SBCONN_MAX_SIZE, slpmsg->slpcall->u.outgoing.len);
 			msn_message_set_bin_data(msg, slpmsg->slpcall->u.outgoing.data, len);
 		}
 		else
 		{
 			len = slpmsg->size - slpmsg->offset;
 
-			if (len > 1202)
-				len = 1202;
+			if (len > MSN_SBCONN_MAX_SIZE)
+				len = MSN_SBCONN_MAX_SIZE;
 
 			msn_message_set_bin_data(msg, slpmsg->buffer + slpmsg->offset, len);
 		}


More information about the Commits mailing list