cpw.malu.xmpp.jingle_ft: 775a9f84: Don't send candidate-error more than onc...

malu at pidgin.im malu at pidgin.im
Sun Jun 6 14:25:41 EDT 2010


-----------------------------------------------------------------
Revision: 775a9f847e8c3801a2f384bbdf89183db8dfd659
Ancestor: 665c9dc6b4373984c459da460368975fc7dd2386
Author: malu at pidgin.im
Date: 2010-06-06T18:18:04
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/775a9f847e8c3801a2f384bbdf89183db8dfd659

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

ChangeLog: 

Don't send candidate-error more than once

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/s5b.c	f0785580714037a8410689c6b841f999b5c44098
+++ libpurple/protocols/jabber/jingle/s5b.c	1dde3c645af5c2dd106a00005acadf1888f26eb5
@@ -227,6 +227,7 @@ struct _JingleS5BPrivate {
 	gboolean is_connected_to_remote;
 	gboolean is_remote_connected;
 	gboolean had_proxy_error;
+	gboolean had_candidate_error;
 };
 
 #define JINGLE_S5B_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), JINGLE_TYPE_S5B, JingleS5BPrivate))
@@ -1142,7 +1143,10 @@ jingle_s5b_attempt_connect_internal(gpoi
 			FALSE, jingle_s5b_connect_cb, jingle_s5b_connect_timeout_cb);
 	} else {
 		/* send candidate error */
-		jabber_iq_send(jingle_s5b_create_candidate_error(session));
+		if (!s5b->priv->had_candidate_error) {
+			jabber_iq_send(jingle_s5b_create_candidate_error(session));
+			s5b->priv->had_candidate_error = TRUE;
+		}
 		
 		/* if the other end could connect to us (they sent a "candidate-used")
 		 we should use that */
@@ -1234,8 +1238,10 @@ jingle_s5b_handle_transport_info(JingleS
 		if (!next_to_try || next_to_try->priority < cand->priority) {
 			/* we don't have any remaining candidates to try, send a
 			 candidate-error if we aren't connected to the other client */
-			if (!s5b->priv->successful_remote_candidate) {
+			if (!s5b->priv->successful_remote_candidate &&
+			    !s5b->priv->had_candidate_error) {
 				jabber_iq_send(jingle_s5b_create_candidate_error(session));
+				s5b->priv->had_candidate_error = TRUE;
 			}
 	
 			jingle_s5b_stop_connection_attempts(s5b);


More information about the Commits mailing list