jingle: build transport with udp candidates only release-2.x.y

Thu, 04 Jul 2019 13:29:30 +0200

author
Fabrice Bellet <fabrice@bellet.info>
date
Thu, 04 Jul 2019 13:29:30 +0200
branch
release-2.x.y
changeset 39727
7a40ca5585ca
parent 39726
e136207df0ee
child 39728
2fa2ef0e0bf1

jingle: build transport with udp candidates only

libpurple/protocols/jabber/jingle/rtp.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/jingle/rtp.c	Tue Jul 02 22:48:54 2019 +0200
+++ b/libpurple/protocols/jabber/jingle/rtp.c	Thu Jul 04 13:29:30 2019 +0200
@@ -283,11 +283,14 @@
 		JingleRawUdpCandidate *rawudp_candidate;
 		for (; candidates; candidates = g_list_next(candidates)) {
 			PurpleMediaCandidate *candidate = candidates->data;
-			rawudp_candidate = jingle_rtp_candidate_to_rawudp(
-					session, generation, candidate);
-			jingle_rawudp_add_local_candidate(
-					JINGLE_RAWUDP(transport),
-					rawudp_candidate);
+			if (purple_media_candidate_get_protocol(candidate) ==
+					PURPLE_MEDIA_NETWORK_PROTOCOL_UDP) {
+				rawudp_candidate = jingle_rtp_candidate_to_rawudp(
+						session, generation, candidate);
+				jingle_rawudp_add_local_candidate(
+						JINGLE_RAWUDP(transport),
+						rawudp_candidate);
+			}
 		}
 		return transport;
 	} else if (type == JINGLE_TYPE_ICEUDP) {
@@ -295,11 +298,14 @@
 		JingleIceUdpCandidate *iceudp_candidate;
 		for (; candidates; candidates = g_list_next(candidates)) {
 			PurpleMediaCandidate *candidate = candidates->data;
-			iceudp_candidate = jingle_rtp_candidate_to_iceudp(
-					session, generation, candidate);
-			jingle_iceudp_add_local_candidate(
-					JINGLE_ICEUDP(transport),
-					iceudp_candidate);
+			if (purple_media_candidate_get_protocol(candidate) ==
+					PURPLE_MEDIA_NETWORK_PROTOCOL_UDP) {
+				iceudp_candidate = jingle_rtp_candidate_to_iceudp(
+						session, generation, candidate);
+				jingle_iceudp_add_local_candidate(
+						JINGLE_ICEUDP(transport),
+						iceudp_candidate);
+			}
 		}
 		return transport;
 	} else {

mercurial