SHA256
1
0
forked from pool/libnice

4 Commits

Author SHA256 Message Date
45820e413a Accepting request 1232631 from GNOME:Factory
OBS-URL: https://build.opensuse.org/request/show/1232631
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnice?expand=0&rev=50
2024-12-20 14:24:18 +00:00
b2792ee498 - Increase test timeout on s390x. test-send-recv can be slow and
sometimes times out in our builds.
- Add 37eeeb1a750bf2dd6d5769d759069e95dd1b8493.patch:
  test-new-trickle: Remove cancellable as a wakeup mechanism.
- Add c47a7ea6289187857a38e0118bd8528cab9171c9.patch meson: Add
  glib debug, assert and check options.

OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/libnice?expand=0&rev=84
2024-12-19 15:38:16 +00:00
808127e621 Accepting request 1222968 from GNOME:Factory
OBS-URL: https://build.opensuse.org/request/show/1222968
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libnice?expand=0&rev=49
2024-11-11 12:43:28 +00:00
70a8dba77f - Update to version 0.1.22:
+ API: Make nice_address_is_local() available to applications
  + Make padding be all zeros to conform to RFC8489
  + Fix interface listing on Android
  + Include TURN sockets in the list from nice_agent_get_sockets()
  + Set consent refresh timeout in line with RFC 7675
  + Fix ifr_ifindex build with cland and OpenBSD
- Drop 4b63250c.patch: Fixed upstream.
- Rebase patch with quilt.

OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/libnice?expand=0&rev=82
2024-11-09 13:30:32 +00:00
8 changed files with 366 additions and 49 deletions

View File

@@ -0,0 +1,226 @@
From 37eeeb1a750bf2dd6d5769d759069e95dd1b8493 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= <olivier.crete@collabora.com>
Date: Thu, 14 Nov 2024 11:16:14 -0500
Subject: [PATCH] test-new-trickle: Remove cancellable as a wakeup mechanism
Just wake up the main context directly instead. This was causing a regression
with GLib 2.83
Fixes #198
---
tests/test-new-trickle.c | 36 +++---------------------------------
1 file changed, 3 insertions(+), 33 deletions(-)
diff --git a/tests/test-new-trickle.c b/tests/test-new-trickle.c
index da808dae..e80048e5 100644
--- a/tests/test-new-trickle.c
+++ b/tests/test-new-trickle.c
@@ -67,7 +67,6 @@ static GCond *stun_thread_signal_ptr = &stun_thread_signal;
static NiceComponentState global_lagent_state = NICE_COMPONENT_STATE_LAST;
static NiceComponentState global_ragent_state = NICE_COMPONENT_STATE_LAST;
-static GCancellable *global_cancellable;
static gboolean exit_stun_thread = FALSE;
static gboolean lagent_candidate_gathering_done = FALSE;
static gboolean ragent_candidate_gathering_done = FALSE;
@@ -225,7 +224,7 @@ recv_packet:
buf_len = stun_agent_finish_message (agent, &response, NULL, 0);
send_buf:
- g_cancellable_cancel (global_cancellable);
+ g_main_context_wakeup (NULL);
g_debug ("Ready to send a STUN response");
g_assert_true (g_mutex_trylock (stun_mutex_ptr));
got_stun_packet = TRUE;
@@ -292,7 +291,6 @@ static void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpoin
g_debug ("ragent finished gathering candidates");
ragent_candidate_gathering_done = TRUE;
}
- g_cancellable_cancel (global_cancellable);
}
static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id, guint len, gchar *buf, gpointer user_data)
@@ -309,7 +307,7 @@ static void cb_nice_recv (NiceAgent *agent, guint stream_id, guint component_id,
g_debug ("test-tricklemode:%s: ragent recieved %d bytes : quit mainloop",
G_STRFUNC, len);
data_received = TRUE;
- g_cancellable_cancel (global_cancellable);
+ g_main_context_wakeup (NULL);
}
}
@@ -333,7 +331,7 @@ static void cb_component_state_changed (NiceAgent *agent, guint stream_id, guint
send_stun = TRUE;
g_cond_signal (stun_signal_ptr);
g_mutex_unlock (stun_mutex_ptr);
- g_cancellable_cancel (global_cancellable);
+ g_main_context_wakeup (NULL);
}
if(GPOINTER_TO_UINT(data) == 1 && state == NICE_COMPONENT_STATE_READY) {
@@ -492,7 +490,6 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
nice_agent_gather_candidates (ragent, global_rs_id);
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (ragent_candidate_gathering_done);
g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
@@ -503,7 +500,6 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
while (!data_received)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (global_lagent_state >= NICE_COMPONENT_STATE_CONNECTED &&
data_received);
@@ -513,14 +509,12 @@ static void standard_test(NiceAgent *lagent, NiceAgent *ragent)
while (!lagent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (lagent_candidate_gathering_done);
g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
while (global_ragent_state < NICE_COMPONENT_STATE_CONNECTED)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_cmpint (global_lagent_state, ==, NICE_COMPONENT_STATE_READY);
g_assert_cmpint (global_ragent_state, >=, NICE_COMPONENT_STATE_CONNECTED);
@@ -542,14 +536,12 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
nice_agent_gather_candidates (lagent, global_ls_id);
while (!got_stun_packet)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
!lagent_candidate_gathering_done);
nice_agent_gather_candidates (ragent, global_rs_id);
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (ragent_candidate_gathering_done);
g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
@@ -558,7 +550,6 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
while (global_lagent_state != NICE_COMPONENT_STATE_FAILED)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
// Set the correct credentials and swap candidates
g_debug ("Setting local candidates of ragent as remote candidates of lagent");
@@ -571,7 +562,6 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
while (!data_received)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (data_received);
g_assert_cmpint (global_lagent_state, ==, NICE_COMPONENT_STATE_READY);
@@ -580,7 +570,6 @@ static void bad_credentials_test(NiceAgent *lagent, NiceAgent *ragent)
// Wait for lagent to finish gathering candidates
while (!lagent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (lagent_candidate_gathering_done);
g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
@@ -599,14 +588,12 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
nice_agent_gather_candidates (lagent, global_ls_id);
while (!got_stun_packet)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
!lagent_candidate_gathering_done);
nice_agent_gather_candidates (ragent, global_rs_id);
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (ragent_candidate_gathering_done);
g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
@@ -616,14 +603,12 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
// lagent will finish candidate gathering causing this mainloop to quit
while (!lagent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
// connchecks will fail causing this mainloop to quit
while (global_lagent_state != NICE_COMPONENT_STATE_FAILED)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_FAILED &&
!data_received);
@@ -638,7 +623,6 @@ static void bad_candidate_test(NiceAgent *lagent,NiceAgent *ragent)
while (!data_received)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (lagent_candidate_gathering_done);
@@ -659,20 +643,17 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
nice_agent_gather_candidates (lagent, global_ls_id);
while (!got_stun_packet)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (global_lagent_state == NICE_COMPONENT_STATE_GATHERING &&
!lagent_candidate_gathering_done);
nice_agent_gather_candidates (ragent, global_rs_id);
while (!ragent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (nice_agent_peer_candidate_gathering_done (lagent, global_ls_id));
// Wait for data
while (!data_received)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (data_received);
// Data arrived, signal STUN thread to send STUN response
@@ -684,7 +665,6 @@ static void new_candidate_test(NiceAgent *lagent, NiceAgent *ragent)
// Wait for lagent to finish gathering candidates
while (!lagent_candidate_gathering_done)
g_main_context_iteration (NULL, TRUE);
- g_cancellable_reset (global_cancellable);
g_assert_true (nice_agent_peer_candidate_gathering_done (ragent, global_rs_id));
g_assert_true (lagent_candidate_gathering_done);
@@ -719,14 +699,8 @@ int main(void)
NiceAgent *lagent = NULL, *ragent = NULL;
GThread *stun_thread = NULL;
NiceAddress baseaddr;
- GSource *src;
int sock;
- global_cancellable = g_cancellable_new ();
- src = g_cancellable_source_new (global_cancellable);
- g_source_set_dummy_callback (src);
- g_source_attach (src, NULL);
-
sock = listen_socket (&stun_port);
if (sock == -1) {
@@ -795,10 +769,6 @@ int main(void)
g_object_unref (ragent);
g_thread_join (stun_thread);
- g_object_unref (global_cancellable);
-
- g_source_destroy (src);
- g_source_unref (src);
WAIT_UNTIL_UNSET (lagent, NULL);
WAIT_UNTIL_UNSET (ragent, NULL);
--
GitLab

View File

@@ -1,37 +0,0 @@
From 4b63250cc446e25b5150dd6040028624ee76f9d1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 22 May 2023 19:45:28 -0700
Subject: [PATCH] agent/meson: Replace filename with basename
This avoids emitting absolute paths into generated sourcecode, it
improves reproducibility. See [1]
[1] https://developer-old.gnome.org/gobject/stable/glib-mkenums.html
---
agent/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/agent/meson.build b/agent/meson.build
index 2e5b272a..44fcd6bd 100644
--- a/agent/meson.build
+++ b/agent/meson.build
@@ -29,14 +29,14 @@ gnome = import('gnome')
agent_enum_types_c = gnome.mkenums('agent-enum-types.c', sources : agent_headers,
fhead: '#include <config.h>\n#include <glib-object.h>\n#include "agent.h"\n#include "pseudotcp.h"\n#include "agent-enum-types.h"',
- fprod: '\n/* enumerations from "@filename@" */',
+ fprod: '\n/* enumerations from "@basename@" */',
vhead: 'GType\n@enum_name@_get_type (void)\n{\n static GType type = 0;\n if (!type) {\n static const G@Type@Value values[] = {',
vprod: ' { @VALUENAME@, "@VALUENAME@", "@valuenick@" },',
vtail: ' { 0, NULL, NULL }\n };\n type = g_@type@_register_static ("@EnumName@", values);\n }\n return type;\n}\n\n')
agent_enum_types_h = gnome.mkenums('agent-enum-types.h', sources : agent_headers,
fhead: '#ifndef __AGENT_ENUM_TYPES_H__\n#define __AGENT_ENUM_TYPES_H__ 1\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n',
- fprod: '/* enumerations from "@filename@" */\n',
+ fprod: '/* enumerations from "@basename@" */\n',
vhead: 'GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define NICE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n',
ftail: 'G_END_DECLS\n\n#endif /* !AGENT_ENUM_TYPES_H */')
--
GitLab

View File

@@ -0,0 +1,91 @@
From c47a7ea6289187857a38e0118bd8528cab9171c9 Mon Sep 17 00:00:00 2001
From: Jeffery Wilson <jeff@jeffalwilson.com>
Date: Thu, 27 Jun 2024 13:14:32 -0400
Subject: [PATCH] meson: Add glib debug, assert and check options
Adds `glib_debug`, `glib_assert`, and `glib_checks` options so that glib
can inherit their value. Furthermore, with
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1165
libnice will inherit these values from GStreamer.
---
meson.build | 22 ++++++++++++++++++++++
meson_options.txt | 9 +++++++++
tests/meson.build | 7 ++++++-
3 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 39d943df..51abfe0b 100644
--- a/meson.build
+++ b/meson.build
@@ -85,6 +85,28 @@ add_project_arguments('-D_GNU_SOURCE',
'-DNICE_VERSION_NANO=' + version_nano,
language: 'c')
+# Same logic as in GLib.
+glib_debug = get_option('glib_debug')
+disable_cast_checks = glib_debug.disabled() or (
+ glib_debug.auto() and (not get_option('debug') or get_option('optimization') not in [ '0', 'g' ]))
+if disable_cast_checks
+ message('Disabling GLib cast checks')
+ add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c')
+ disable_cast_checks = true
+endif
+
+disable_glib_asserts = not get_option('glib_assert')
+if disable_glib_asserts
+ message('Disabling GLib asserts')
+ add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
+endif
+
+disable_glib_checks = not get_option('glib_checks')
+if disable_glib_checks
+ message('Disabling GLib checks')
+ add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
+endif
+
cdata = configuration_data()
cdata.set_quoted('PACKAGE_STRING', meson.project_name())
diff --git a/meson_options.txt b/meson_options.txt
index cd980cb5..a720d742 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,6 +7,15 @@ option('ignored-network-interface-prefix', type: 'array', value: ['docker', 'vet
option('crypto-library', type: 'combo', choices : ['auto', 'gnutls', 'openssl'], value : 'auto')
# Common feature options
+option('glib_debug', type : 'feature', value : 'auto', yield : true,
+ description : 'Enable GLib debug infrastructure (see docs/macros.txt)',
+)
+option('glib_assert', type : 'boolean', value : true, yield : true,
+ description : 'Enable GLib assertion (see docs/macros.txt)',
+)
+option('glib_checks', type : 'boolean', value : true, yield : true,
+ description : 'Enable GLib checks such as API guards (see docs/macros.txt)',
+)
option('examples', type : 'feature', value : 'auto', yield : true,
description: 'Build examples')
option('tests', type : 'feature', value : 'auto', yield : true,
diff --git a/tests/meson.build b/tests/meson.build
index f1495509..c66ffbde 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -76,9 +76,14 @@ if gst_dep.found() and not static_build
gst_check = dependency('gstreamer-check-1.0', required: get_option('gstreamer'),
fallback : ['gstreamer', 'gst_check_dep'])
if gst_check.found()
+ test_defines = [
+ '-DG_LOG_DOMAIN="libnice-tests"',
+ '-UG_DISABLE_ASSERT',
+ '-UG_DISABLE_CAST_CHECKS',
+ ]
exe = executable('nice-test-gstreamer',
'test-gstreamer.c', extra_src,
- c_args: '-DG_LOG_DOMAIN="libnice-tests"',
+ c_args: test_defines,
include_directories: nice_incs,
dependencies: [nice_deps, gst_check, libm],
link_with: libnice,
--
GitLab

Binary file not shown.

BIN
libnice-0.1.22.tar.gz LFS Normal file

Binary file not shown.

View File

@@ -1,8 +1,8 @@
Index: libnice-0.1.21/meson.build
Index: libnice-0.1.22/meson.build
===================================================================
--- libnice-0.1.21.orig/meson.build
+++ libnice-0.1.21/meson.build
@@ -278,7 +278,7 @@ gst_dep = dependency('gstreamer-base-1.0
--- libnice-0.1.22.orig/meson.build
+++ libnice-0.1.22/meson.build
@@ -276,7 +276,7 @@ gst_dep = dependency('gstreamer-base-1.0
cdata.set('HAVE_GSTREAMER', gst_dep.found(), description: 'Build GStreamer plugin')
# GUPnP IGD

View File

@@ -1,3 +1,34 @@
-------------------------------------------------------------------
Mon Dec 9 14:55:31 UTC 2024 - Bjørn Lie <bjorn.lie@gmail.com>
- Increase test timeout on s390x. test-send-recv can be slow and
sometimes times out in our builds.
-------------------------------------------------------------------
Sat Nov 16 19:44:22 UTC 2024 - Bjørn Lie <bjorn.lie@gmail.com>
- Add 37eeeb1a750bf2dd6d5769d759069e95dd1b8493.patch:
test-new-trickle: Remove cancellable as a wakeup mechanism.
-------------------------------------------------------------------
Mon Nov 11 19:49:29 UTC 2024 - Bjørn Lie <bjorn.lie@gmail.com>
- Add c47a7ea6289187857a38e0118bd8528cab9171c9.patch meson: Add
glib debug, assert and check options.
-------------------------------------------------------------------
Fri Nov 8 13:02:01 UTC 2024 - Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 0.1.22:
+ API: Make nice_address_is_local() available to applications
+ Make padding be all zeros to conform to RFC8489
+ Fix interface listing on Android
+ Include TURN sockets in the list from nice_agent_get_sockets()
+ Set consent refresh timeout in line with RFC 7675
+ Fix ifr_ifindex build with cland and OpenBSD
- Drop 4b63250c.patch: Fixed upstream.
- Rebase patch with quilt.
-------------------------------------------------------------------
Fri Jul 7 10:26:09 UTC 2023 - Bjørn Lie <bjorn.lie@gmail.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package libnice
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,18 +17,20 @@
Name: libnice
Version: 0.1.21
Version: 0.1.22
Release: 0
Summary: Interactive Connectivity Establishment implementation
License: LGPL-2.1-only OR MPL-1.1
Group: Development/Libraries/GNOME
URL: https://nice.freedesktop.org/
Source: https://nice.freedesktop.org/releases/%{name}-%{version}.tar.gz
Source: %{url}/releases/%{name}-%{version}.tar.gz
Source1: baselibs.conf
# PATCH-FIX-UPSTREAM libnice-port-gupnp-igd-bump.patch -- Port to new gupnp-igd
Patch1: libnice-port-gupnp-igd-bump.patch
# PATCH-FIX-UPSTREAM 4b63250c.patch -- agent/meson: Replace filename with basename
Patch2: https://gitlab.freedesktop.org/libnice/libnice/-/commit/4b63250c.patch
# PATCH-FIX-UPSTREAM c47a7ea6289187857a38e0118bd8528cab9171c9.patch -- meson: Add glib debug, assert and check options
Patch2: https://gitlab.freedesktop.org/libnice/libnice/-/commit/c47a7ea6289187857a38e0118bd8528cab9171c9.patch
# PATCH-FIX-UPSTREAM 37eeeb1a750bf2dd6d5769d759069e95dd1b8493.patch -- test-new-trickle: Remove cancellable as a wakeup mechanism
Patch3: https://gitlab.freedesktop.org/libnice/libnice/-/commit/37eeeb1a750bf2dd6d5769d759069e95dd1b8493.patch
BuildRequires: meson
BuildRequires: pkgconfig
@@ -96,7 +98,11 @@ sed -e 's/^ '\''test-set-port-range'\''/#&/' -i tests/meson.build
%meson_install
%check
%ifarch s390x
%meson_test -t 5
%else
%meson_test
%endif
%ldconfig_scriptlets -n libnice10