cpw.malu.xmpp.jingle_ft: 68e69940: Adjusted IBB to only send block-size of ...

malu at pidgin.im malu at pidgin.im
Thu Mar 18 17:45:36 EDT 2010


-----------------------------------------------------------------
Revision: 68e699402650ba38372a1391f7c76e5c480909af
Ancestor: d9902f56469e034a5af37f485e17b7ef6ba3bc85
Author: malu at pidgin.im
Date: 2010-03-18T21:43:36
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/68e699402650ba38372a1391f7c76e5c480909af

Modified files:
        libpurple/protocols/jabber/jingle/file-transfer.c
        libpurple/protocols/jabber/jingle/ibbs.c
        libpurple/protocols/jabber/jingle/ibbs.h

ChangeLog: 

Adjusted IBB to only send block-size of encoded data in each packet.
Don't initialise the IBB circbuffer twice when being the initiator and
doing the transport-replace

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c	0036beded6c4defc0383009e891ff61d00e73c27
+++ libpurple/protocols/jabber/jingle/file-transfer.c	21b345fd0c894764322a0fc5693b7a444a74b375
@@ -199,8 +199,8 @@ jingle_file_transfer_ibb_write(const guc
 {
 	JingleContent *content = (JingleContent *) xfer->data;
 	JingleTransport *transport = jingle_content_get_transport(content);
-	gsize packet_size = len < jingle_ibb_get_block_size(JINGLE_IBB(transport)) ?
-		len : jingle_ibb_get_block_size(JINGLE_IBB(transport));
+	gsize packet_size = len < jingle_ibb_get_max_data_size(JINGLE_IBB(transport)) ?
+		len : jingle_ibb_get_max_data_size(JINGLE_IBB(transport));
 
 	jingle_ibb_send_data(JINGLE_IBB(transport), buffer, packet_size);
 	g_object_unref(transport);
@@ -301,7 +301,7 @@ jingle_file_transfer_add_ibb_session_to_
 		jingle_ibb_set_error_callback(JINGLE_IBB(transport),
 			jingle_file_transfer_ibb_error_callback);
 		JINGLE_FT(content)->priv->ibb_buffer = 
-			purple_circ_buffer_new(jingle_ibb_get_block_size(
+			purple_circ_buffer_new(jingle_ibb_get_max_data_size(
 				JINGLE_IBB(transport)));
 	} else {
 		purple_debug_error("jingle-ft",
@@ -833,9 +833,6 @@ jingle_file_transfer_handle_action_inter
 				"got transport-accept transport %p\n", transport);
 			
 			if (JINGLE_IS_IBB(transport)) {
-				JINGLE_FT(content)->priv->ibb_buffer =
-					purple_circ_buffer_new(jingle_ibb_get_block_size(JINGLE_IBB(transport)));
-				
 				purple_xfer_set_write_fnc(xfer, jingle_file_transfer_ibb_write);
 
 				if (xmltransport) {
============================================================
--- libpurple/protocols/jabber/jingle/ibbs.c	1eaaac3f95fe0d35e889a361c5abf8fc11fd89f8
+++ libpurple/protocols/jabber/jingle/ibbs.c	49117181bc65e3defa8b134e2aefa0b46066d121
@@ -347,6 +347,13 @@ jingle_ibb_set_block_size(JingleIBB *ibb
 	}
 }
 
+gsize
+jingle_ibb_get_max_data_size(const JingleIBB *ibb)
+{
+	return jabber_ibb_session_get_max_data_size(
+	    JINGLE_IBB_GET_PRIVATE(ibb)->session);
+}
+
 void
 jingle_ibb_handle_session_accept(JingleIBB *ibb, xmlnode *transport)
 {
============================================================
--- libpurple/protocols/jabber/jingle/ibbs.h	7c577f77784ac73fba9a1f6cc91baca2261ce781
+++ libpurple/protocols/jabber/jingle/ibbs.h	982909d114e53b367770eeff8284a8536db3a5f4
@@ -86,6 +86,9 @@ gsize jingle_ibb_get_block_size(const Ji
 /* get the (max) block size of the IBB session */
 gsize jingle_ibb_get_block_size(const JingleIBB *ibb);
 
+/* get the (max) data size (unencoded data block size) */
+gsize jingle_ibb_get_max_data_size(const JingleIBB *ibb);
+	
 void jingle_ibb_handle_session_accept(JingleIBB *ibb, xmlnode *transport);
 void jingle_ibb_handle_transport_accept(JingleIBB *ibb, xmlnode *transport);
 


More information about the Commits mailing list