cpw.malu.xmpp.jingle_ft: 8bcef266: When acting as the initiator, only set t...

malu at pidgin.im malu at pidgin.im
Wed Mar 17 19:05:43 EDT 2010


-----------------------------------------------------------------
Revision: 8bcef26698169f382f630139bc3d6bd0de3e22b0
Ancestor: fb9b899c752d12814449dd4564c35f1e24c45aa7
Author: malu at pidgin.im
Date: 2010-03-17T22:59:30
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/8bcef26698169f382f630139bc3d6bd0de3e22b0

Modified files:
        libpurple/protocols/jabber/jingle/ibbs.c

ChangeLog: 

When acting as the initiator, only set the IBB session to "open" when receiving
session-accept or transport-accept (depending on previous flow).
This lets the receiver changing block-size actually work, plus it ensures
the initiator can't attempt to send data before the stream is accepted.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/ibbs.c	b09b00e193b6cfe0b45ada5051cb1399d27b0fee
+++ libpurple/protocols/jabber/jingle/ibbs.c	1eaaac3f95fe0d35e889a361c5abf8fc11fd89f8
@@ -277,10 +277,16 @@ jingle_ibb_create_session(JingleIBB *ibb
 	if (ibb->priv->block_size) {
 		jabber_ibb_session_set_block_size(session, ibb->priv->block_size);
 	}
-	/* we will set the IBB session to "open" immediatly, since the Jingle
-	 negotiation defines the "open" state */
-	jabber_ibb_session_set_state(session, JABBER_IBB_SESSION_OPENED);
 
+	if (!jingle_session_is_initiator(sess)) {
+		/* we will set the IBB session to "open" immediatly, since the Jingle
+	 	negotiation defines the "open" state
+		 Note: for the the initiator, this is done when getting a 
+		 session-accept or transport-accept, since the block-size might get
+		 changed by request from the receiver */
+		jabber_ibb_session_set_state(session, JABBER_IBB_SESSION_OPENED);
+	}
+	
 	/* set callbacks... */
 	jabber_ibb_session_set_data_sent_callback(session, 
 		jingle_ibb_data_sent_callback);
@@ -349,6 +355,8 @@ jingle_ibb_handle_session_accept(JingleI
 	if (block_size) {
 		jingle_ibb_set_block_size(ibb, atoi(block_size));
 	}
+
+	jabber_ibb_session_set_state(ibb->priv->session, JABBER_IBB_SESSION_OPENED);	
 }
 
 void
@@ -359,4 +367,6 @@ jingle_ibb_handle_transport_accept(Jingl
 	if (block_size) {
 		jingle_ibb_set_block_size(ibb, atoi(block_size));
 	}
+
+	jabber_ibb_session_set_state(ibb->priv->session, JABBER_IBB_SESSION_OPENED);
 }


More information about the Commits mailing list