Skip to content
Commits on Source (6)
1.4.1 (stable)
=====
- Fix regression in async deprecated API
- Fix context creation not failing if the HTTP server fails to bind
Bugs fixed in this release:
- https://gitlab.gnome.org/GNOME/gupnp/issues/58
All contributors to this release:
- Jens Georg <mail@jensge.org>
1.4.0 (stable)
=====
......
......@@ -608,6 +608,7 @@ gupnp_context_get_server (GUPnPContext *context)
if (! soup_server_listen (priv->server,
addr, (SoupServerListenOptions) 0, &error)) {
g_clear_object(&priv->server);
g_warning ("GUPnPContext: Unable to listen on %s:%u %s", ip, priv->port, error->message);
g_error_free (error);
}
......
......@@ -911,7 +911,6 @@ gupnp_service_proxy_end_action (GUPnPServiceProxy *proxy,
g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
g_return_val_if_fail (action, FALSE);
g_return_val_if_fail (proxy == action->proxy, FALSE);
if (action->error) {
g_propagate_error (error, action->error);
......@@ -953,7 +952,6 @@ gupnp_service_proxy_end_action_valist (GUPnPServiceProxy *proxy,
g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
g_return_val_if_fail (action, FALSE);
g_return_val_if_fail (proxy == action->proxy, FALSE);
if (action->error) {
g_propagate_error (error, action->error);
......@@ -1002,7 +1000,6 @@ gupnp_service_proxy_end_action_list (GUPnPServiceProxy *proxy,
g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
g_return_val_if_fail (action, FALSE);
g_return_val_if_fail (proxy == action->proxy, FALSE);
/* Check for saved error from begin_action() */
if (action->error) {
......@@ -1047,7 +1044,6 @@ gupnp_service_proxy_end_action_hash
g_return_val_if_fail (GUPNP_IS_SERVICE_PROXY (proxy), FALSE);
g_return_val_if_fail (action, FALSE);
g_return_val_if_fail (proxy == action->proxy, FALSE);
/* Check for saved error from begin_action() */
if (action->error) {
......@@ -1082,7 +1078,6 @@ gupnp_service_proxy_cancel_action (GUPnPServiceProxy *proxy,
{
g_return_if_fail (GUPNP_IS_SERVICE_PROXY (proxy));
g_return_if_fail (action);
g_return_if_fail (proxy == action->proxy);
if (action->cancellable != NULL) {
g_cancellable_cancel (action->cancellable);
......
project('gupnp', 'c', version : '1.4.0', meson_version : '>= 0.54.0')
project('gupnp', 'c', version : '1.4.1', meson_version : '>= 0.54.0')
gnome = import('gnome')
pkg = import('pkgconfig')
......
[wrap-git]
url = https://gitlab.gnome.org/GNOME/gssdp.git
revision = master
revision = gssdp-1.4
depth = 1
[provides]
......
......@@ -42,6 +42,9 @@
</stateVariable>
</serviceStateTable>
<actionList>
<action>
<name>Ping</name>
</action>
<action>
<name>Browse</name>
<argumentList>
......
......@@ -523,6 +523,143 @@ test_ggo_24 (void)
validate_host_header ("[fe80::01%eth0]", "fe80::acab", 4711));
}
/*
* Test that the legacy async _end_action calls still work
*
* https://gitlab.gnome.org/GNOME/gupnp/-/issues/58
*/
static void
test_ggo_58_on_ping (GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
gpointer user_data)
{
TestServiceProxyData *data = (TestServiceProxyData *) user_data;
g_main_loop_quit (data->loop);
}
static void
test_ggo_58_on_ping_call (GUPnPService *service,
GUPnPServiceAction *action,
gpointer user_data)
{
gupnp_service_action_return (action);
}
static void
test_ggo_58 ()
{
GUPnPContext *context = NULL;
GError *error = NULL;
GUPnPControlPoint *cp = NULL;
GUPnPRootDevice *rd;
TestServiceProxyData data = { NULL, NULL };
GUPnPServiceInfo *info = NULL;
data.loop = g_main_loop_new (NULL, FALSE);
context = create_context (0, &error);
g_assert_no_error (error);
g_assert (context != NULL);
cp = gupnp_control_point_new (
context,
"urn:test-gupnp-org:service:TestService:1");
gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE);
g_signal_connect (G_OBJECT (cp),
"service-proxy-available",
G_CALLBACK (test_on_sp_available),
&data);
rd = gupnp_root_device_new (context,
"TestDevice.xml",
DATA_PATH,
&error);
g_assert_no_error (error);
g_assert (rd != NULL);
gupnp_root_device_set_available (rd, TRUE);
info = gupnp_device_info_get_service (
GUPNP_DEVICE_INFO (rd),
"urn:test-gupnp-org:service:TestService:1");
g_signal_connect (G_OBJECT (info),
"action-invoked::Ping",
G_CALLBACK (test_ggo_58_on_ping_call),
&data);
test_run_loop (data.loop);
g_assert (data.proxy != NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GUPnPServiceProxyAction *action =
gupnp_service_proxy_begin_action (data.proxy,
"Ping",
test_ggo_58_on_ping,
&data,
NULL);
test_run_loop (data.loop);
gboolean success = gupnp_service_proxy_end_action (data.proxy,
action,
&error,
NULL);
g_assert (success);
g_assert_no_error (error);
action = gupnp_service_proxy_begin_action (data.proxy,
"Ping",
test_ggo_58_on_ping,
&data,
NULL);
test_run_loop (data.loop);
GHashTable *result_hash = g_hash_table_new (g_str_hash, g_str_equal);
success = gupnp_service_proxy_end_action_hash (data.proxy,
action,
result_hash,
&error);
g_hash_table_destroy (result_hash);
g_assert (success);
g_assert_no_error (error);
action = gupnp_service_proxy_begin_action (data.proxy,
"Ping",
test_ggo_58_on_ping,
&data,
NULL);
test_run_loop (data.loop);
GList *result_list = NULL;
success = gupnp_service_proxy_end_action_list (data.proxy,
action,
NULL,
NULL,
&result_list,
&error);
g_assert (success);
g_assert_no_error (error);
G_GNUC_END_IGNORE_DEPRECATIONS
g_object_unref (info);
g_object_unref (data.proxy);
g_object_unref (cp);
g_object_unref (rd);
g_object_unref (context);
g_main_loop_unref (data.loop);
}
int
main (int argc, char *argv[]) {
g_test_init (&argc, &argv, NULL);
......@@ -532,6 +669,7 @@ main (int argc, char *argv[]) {
g_test_add_func ("/bugs/bgo/722696", test_bgo_722696);
g_test_add_func ("/bugs/bgo/743233", test_bgo_743233);
g_test_add_func ("/bugs/ggo/24", test_ggo_24);
g_test_add_func ("/bugs/ggo/58", test_ggo_58);
return g_test_run ();
}