cpw.malu.xmpp.jingle_ft: 586ff24c: Don't try to fallback to IBB immediatly ...

malu at pidgin.im malu at pidgin.im
Fri May 7 17:50:45 EDT 2010


-----------------------------------------------------------------
Revision: 586ff24c6e8ba127506d9b7a0e53c4d82af2eded
Ancestor: 8e0efb9c6fc13e7298e594f80e8d646a6f7716b8
Author: malu at pidgin.im
Date: 2010-05-07T21:47:56
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/586ff24c6e8ba127506d9b7a0e53c4d82af2eded

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

ChangeLog: 

Don't try to fallback to IBB immediatly when the last remote candiate failed, wait until
the remote client sent a candidate-error.
Actually wait for the response to the <open/> call on the IBB transport's IBB session before starting
to send data, also when falling back from S5B.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c	3bdbe407cf489b03360ecd17600969a8bea01a56
+++ libpurple/protocols/jabber/jingle/file-transfer.c	4d623466022d3b6d48508a2d2faae858980dd31e
@@ -854,15 +854,12 @@ jingle_file_transfer_handle_action_inter
 				"got transport-accept transport %p\n", transport);
 			
 			if (JINGLE_IS_IBB(transport)) {
+				jingle_ibb_set_opened_callback(JINGLE_IBB(transport),
+				    jingle_file_transfer_ibb_opened_callback);
 				if (xmltransport) {
 					jingle_ibb_handle_transport_accept(JINGLE_IBB(transport),
 					    xmltransport);
 				}
-				
-				/* send first data */
-				purple_xfer_set_write_fnc(xfer, jingle_file_transfer_ibb_write);
-				purple_xfer_start(xfer, -1, NULL, 0);
-				purple_xfer_prpl_ready(xfer);
 			}
 
 			g_object_unref(session);
============================================================
--- libpurple/protocols/jabber/jingle/s5b.c	b4cf89c97fbda1e633ceff6be9cb2d7633312e66
+++ libpurple/protocols/jabber/jingle/s5b.c	ec1957a5836fa0af26864fdc70133d5e33216fe5
@@ -217,6 +217,7 @@ struct _JingleS5BPrivate {
 	GList *remaining_candidates; /* pointer to untested remote SHs */
 	JingleS5BCandidate *successful_remote_candidate;
 	JingleS5BCandidate *accepted_candidate;
+	gboolean got_candidate_error;
 	JingleS5BConnectCallback *connect_cb;
 	JingleS5BErrorCallback *error_cb;
 	JingleS5BFailedConnectCallback *failed_cb;
@@ -964,6 +965,11 @@ jingle_s5b_proxy_error_cb(JabberStream *
 
 	if (type == JABBER_IQ_RESULT) {
 		if (s5b->priv->failed_cb && s5b->priv->failed_content) {
+			if (s5b->priv->socks5_listen_data) {
+				jabber_socks5_listen_cancel(s5b->priv->socks5_listen_data);
+				jabber_socks5_listen_data_free(s5b->priv->socks5_listen_data);
+				s5b->priv->socks5_listen_data = NULL;
+			}
 			s5b->priv->failed_cb(s5b->priv->failed_content);
 		}
 	} else {
@@ -1148,7 +1154,12 @@ jingle_s5b_attempt_connect_internal(gpoi
 					/* some error? */
 				}
 			}
-		} else {
+		} else if (s5b->priv->got_candidate_error) {
+			if (s5b->priv->socks5_listen_data) {
+				jabber_socks5_listen_cancel(s5b->priv->socks5_listen_data);
+				jabber_socks5_listen_data_free(s5b->priv->socks5_listen_data);
+				s5b->priv->socks5_listen_data = NULL;
+			}
 			/* signal to the content that S5B failed (from our side) */
 			if (s5b->priv->failed_cb && s5b->priv->failed_content)
 				s5b->priv->failed_cb(s5b->priv->failed_content);
@@ -1265,8 +1276,14 @@ jingle_s5b_handle_transport_info(JingleS
 			}
 		}
 	} else if (candidate_error) {
+		s5b->priv->got_candidate_error = TRUE;
 		if (s5b->priv->failed_cb && !s5b->priv->successful_remote_candidate &&
 			!s5b->priv->remaining_candidates) {
+			if (s5b->priv->socks5_listen_data) {
+				jabber_socks5_listen_cancel(s5b->priv->socks5_listen_data);
+				jabber_socks5_listen_data_free(s5b->priv->socks5_listen_data);
+				s5b->priv->socks5_listen_data = NULL;
+			}
 			s5b->priv->failed_cb(s5b->priv->failed_content);
 		} else if (s5b->priv->successful_remote_candidate) {
 			jingle_s5b_surrender(s5b);
@@ -1290,6 +1307,11 @@ jingle_s5b_handle_transport_info(JingleS
 			}
 		}
 	} else if (proxy_error) {
+		if (s5b->priv->socks5_listen_data) {
+			jabber_socks5_listen_cancel(s5b->priv->socks5_listen_data);
+			jabber_socks5_listen_data_free(s5b->priv->socks5_listen_data);
+			s5b->priv->socks5_listen_data = NULL;
+		}
 		if (s5b->priv->failed_cb && s5b->priv->failed_content) {
 			s5b->priv->failed_cb(s5b->priv->failed_content);
 		}


More information about the Commits mailing list