pidgin/pidgin

d75e434521a5
Parents abcf39925619
Children 8ed31ec968af
Port backend-fs to newer api for farstream relay-info property. Fixes #17274
--- a/COPYRIGHT Wed Mar 07 23:45:56 2018 -0600
+++ b/COPYRIGHT Wed Mar 07 23:53:17 2018 -0600
@@ -52,6 +52,7 @@
Carlos Bederian
Dave Bell
Matthew W.S. Bell
+bellet
Igor Belyi
David Benjamin
Brian Bernas
--- a/ChangeLog Wed Mar 07 23:45:56 2018 -0600
+++ b/ChangeLog Wed Mar 07 23:53:17 2018 -0600
@@ -42,6 +42,9 @@
Finch:
* Fix handling of search results (#17238 David Woodhouse)
+ Voice & Video:
+ * Port backend-fs to newer api for farstream relay-info property (#17274 bellet)
+
version 2.12.0 (03/09/2017):
libpurple:
* Fix an out of bounds memory write in purple_markup_unescape_entity.
--- a/libpurple/media/backend-fs2.c Wed Mar 07 23:45:56 2018 -0600
+++ b/libpurple/media/backend-fs2.c Wed Mar 07 23:53:17 2018 -0600
@@ -2093,6 +2093,7 @@
(GSourceFunc)src_pad_added_cb_cb, stream);
}
+#ifdef HAVE_FARSIGHT
static GValueArray *
append_relay_info(GValueArray *relay_info, const gchar *ip, gint port,
const gchar *username, const gchar *password, const gchar *type)
@@ -2118,6 +2119,7 @@
return relay_info;
}
+#endif
static gboolean
create_stream(PurpleMediaBackendFs2 *self,
@@ -2144,6 +2146,10 @@
TURN modes, like Google f.ex. */
gboolean got_turn_from_prpl = FALSE;
guint i;
+#ifndef HAVE_FARSIGHT
+ GPtrArray *relay_info = g_ptr_array_new_full (1, (GDestroyNotify) gst_structure_free);
+ gboolean ret;
+#endif
session = get_session(self, sess_id);
@@ -2208,7 +2214,9 @@
if (turn_ip && purple_strequal("nice", transmitter) && !got_turn_from_prpl) {
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#ifdef HAVE_FARSIGHT
GValueArray *relay_info = g_value_array_new(0);
+#endif
G_GNUC_END_IGNORE_DEPRECATIONS
gint port;
const gchar *username = purple_prefs_get_string(
@@ -2219,15 +2227,37 @@
/* UDP */
port = purple_prefs_get_int("/purple/network/turn_port");
if (port > 0) {
+#ifdef HAVE_FARSIGHT
relay_info = append_relay_info(relay_info, turn_ip, port, username,
password, "udp");
+#else
+ g_ptr_array_add (relay_info,
+ gst_structure_new ("relay-info",
+ "ip", G_TYPE_STRING, turn_ip,
+ "port", G_TYPE_UINT, port,
+ "username", G_TYPE_STRING, username,
+ "password", G_TYPE_STRING, password,
+ "relay-type", G_TYPE_STRING, "udp",
+ NULL));
+#endif
}
/* TCP */
port = purple_prefs_get_int("/purple/network/turn_port_tcp");
if (port > 0) {
+#ifdef HAVE_FARSIGHT
relay_info = append_relay_info(relay_info, turn_ip, port, username,
password, "tcp");
+#else
+ g_ptr_array_add (relay_info,
+ gst_structure_new ("relay-info",
+ "ip", G_TYPE_STRING, turn_ip,
+ "port", G_TYPE_UINT, port,
+ "username", G_TYPE_STRING, username,
+ "password", G_TYPE_STRING, password,
+ "relay-type", G_TYPE_STRING, "tcp",
+ NULL));
+#endif
}
/* TURN over SSL is only supported by libnice for Google's "psuedo" SSL mode
@@ -2237,9 +2267,14 @@
"Setting relay-info on new stream\n");
_params[_num_params].name = "relay-info";
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+#ifdef HAVE_FARSIGHT
g_value_init(&_params[_num_params].value, G_TYPE_VALUE_ARRAY);
g_value_set_boxed(&_params[_num_params].value, relay_info);
g_value_array_free(relay_info);
+#else
+ g_value_init(&_params[_num_params].value, G_TYPE_PTR_ARRAY);
+ g_value_set_boxed(&_params[_num_params].value, relay_info);
+#endif
G_GNUC_END_IGNORE_DEPRECATIONS
_num_params++;
}
@@ -2264,16 +2299,20 @@
return FALSE;
}
#else
- if (!fs_stream_set_transmitter(fsstream, transmitter,
- _params, _num_params, &err)) {
+ ret = fs_stream_set_transmitter(fsstream, transmitter,
+ _params, _num_params, &err);
+ for (i = 0 ; i < _num_params ; i++)
+ g_value_unset (&_params[i].value);
+ g_free(_params);
+ if (relay_info)
+ g_ptr_array_unref (relay_info);
+ if (ret == FALSE) {
purple_debug_error("backend-fs2",
"Could not set transmitter %s: %s.\n",
transmitter, err ? err->message : NULL);
g_clear_error(&err);
- g_free(_params);
return FALSE;
}
- g_free(_params);
#endif
stream = g_new0(PurpleMediaBackendFs2Stream, 1);