Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gupnp for openSUSE:Factory checked in at 2022-01-11 00:01:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gupnp (Old) and /work/SRC/openSUSE:Factory/.gupnp.new.1892 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gupnp" Tue Jan 11 00:01:47 2022 rev:70 rq:945282 version:1.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/gupnp/gupnp.changes 2021-12-12 00:55:58.370516947 +0100 +++ /work/SRC/openSUSE:Factory/.gupnp.new.1892/gupnp.changes 2022-01-11 00:02:19.465262996 +0100 @@ -1,0 +2,21 @@ +Sat Jan 8 11:59:42 UTC 2022 - Bj??rn Lie <bjorn....@gmail.com> + +- Update to version 1.4.2: + + Context: Fix a memory leak if ACL was used + + RootDevice: Deprecate get_relative_location call + + RootDevice, Device & Service: Fix use-after-free if Service + lives longer than RootDevice + + Service: Declare _valist functions deprecated + + ServiceAction: Deprecate _return() call + + ServiceProxy: + - Fix re-queueing the message if POST fails + - Fix double-free on ProxyAction + + ServiceProxyAction: add _set() to the public API + + ControlPoint: Deprecate get_context() call + + Doc: + - Add missing ContextFilter description + - Add note regarding ACL and host_path() + - Add note regarding error handling of call API +- Add gupnp-build-man-pages.patch: Build and install the manpage. + +------------------------------------------------------------------- Old: ---- gupnp-1.4.1.tar.xz New: ---- gupnp-1.4.2.tar.xz gupnp-build-man-pages.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gupnp.spec ++++++ --- /var/tmp/diff_new_pack.UE744x/_old 2022-01-11 00:02:19.993263458 +0100 +++ /var/tmp/diff_new_pack.UE744x/_new 2022-01-11 00:02:20.001263465 +0100 @@ -1,7 +1,7 @@ # # spec file for package gupnp # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,7 +21,7 @@ %define sover 1.2 Name: gupnp -Version: 1.4.1 +Version: 1.4.2 Release: 0 Summary: Implementation of the UPnP specification License: LGPL-2.0-or-later @@ -29,6 +29,9 @@ URL: http://www.gupnp.org/ Source0: https://download.gnome.org/sources/gupnp/1.4/%{name}-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-UPSTREAM gupnp-build-man-pages.patch -- Build and install the manpage +Patch0: gupnp-build-man-pages.patch + BuildRequires: gtk-doc BuildRequires: meson >= 0.54.0 BuildRequires: pkgconfig ++++++ gupnp-1.4.1.tar.xz -> gupnp-1.4.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/NEWS new/gupnp-1.4.2/NEWS --- old/gupnp-1.4.1/NEWS 2021-12-06 18:48:24.978335900 +0100 +++ new/gupnp-1.4.2/NEWS 2022-01-08 11:01:21.194516000 +0100 @@ -1,3 +1,29 @@ +1.4.2 (stable) +===== + +- Context: Fix a memory leak if ACL was used +- Doc: Add missing ContextFilter description +- RootDevice: Deprecate get_relative_location call +- Service: Declare _valist functions deprecated +- ServiceProxyAction: add _set() to the public API +- RootDevice, Device & Service: Fix use-after-free if Service lives + longer than RootDevice +- ServiceAction: Deprecate _return() call +- ControlPoint: Deprecate get_context() call +- ServiceProxy: Fix re-queueing the message if POST fails +- ServiceProxy: Fix double-free on ProxyAction +- Doc: Add note regarding ACL and host_path() +- Doc: Add note regarding error handling of call API + +Bugs fixed in this release: + - https://gitlab.gnome.org/GNOME/gupnp/issues/42 + - https://gitlab.gnome.org/GNOME/gupnp/issues/42 + - https://gitlab.gnome.org/GNOME/gupnp/issues/63 + - https://gitlab.gnome.org/GNOME/gupnp/issues/60 + +All contributors to this release: + - Jens Georg <m...@jensge.org> + 1.4.1 (stable) ===== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/doc/gupnp-docs.xml new/gupnp-1.4.2/doc/gupnp-docs.xml --- old/gupnp-1.4.1/doc/gupnp-docs.xml 2021-12-06 18:48:24.980336000 +0100 +++ new/gupnp-1.4.2/doc/gupnp-docs.xml 2022-01-08 11:01:21.195515900 +0100 @@ -75,12 +75,13 @@ <title>Utility Functions</title> <xi:include href="xml/gupnp-acl.xml"/> - <xi:include href="xml/gupnp-white-list.xml"/> + <xi:include href="xml/gupnp-context-filter.xml"/> <xi:include href="xml/gupnp-resource-factory.xml"/> <xi:include href="xml/gupnp-xml-doc.xml"/> <xi:include href="xml/gupnp-error.xml"/> <xi:include href="xml/gupnp-types.xml"/> <xi:include href="xml/gupnp-misc.xml"/> + <xi:include href="xml/gupnp-white-list.xml"/> </chapter> <chapter id="api-tools"> @@ -182,6 +183,12 @@ <xi:include href="xml/api-index-1.2.0.xml"><xi:fallback /></xi:include> </index> + <index id="api-index-1-4-0" role="1.4.0"> + <title>Index of new symbols in 1.4.0</title> + <xi:include href="xml/api-index-1.4.0.xml"><xi:fallback /></xi:include> + </index> + + <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> <xi:include href="fdl-1.1.xml"><xi:fallback /></xi:include> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/doc/gupnp-sections.txt new/gupnp-1.4.2/doc/gupnp-sections.txt --- old/gupnp-1.4.1/doc/gupnp-sections.txt 2021-12-06 18:48:24.980336000 +0100 +++ new/gupnp-1.4.2/doc/gupnp-sections.txt 2022-01-08 11:01:21.195515900 +0100 @@ -97,6 +97,7 @@ gupnp_service_proxy_action_new_from_list gupnp_service_proxy_action_ref gupnp_service_proxy_action_unref +gupnp_service_proxy_action_set gupnp_service_proxy_action_get_result gupnp_service_proxy_action_get_result_hash gupnp_service_proxy_action_get_result_list @@ -134,8 +135,9 @@ gupnp_service_action_set_valist gupnp_service_action_set_value gupnp_service_action_set_values -gupnp_service_action_return +gupnp_service_action_return_success gupnp_service_action_return_error +gupnp_service_action_return gupnp_service_action_get_message gupnp_service_action_get_argument_count gupnp_service_notify @@ -167,10 +169,11 @@ gupnp_root_device_new_full gupnp_root_device_set_available gupnp_root_device_get_available -gupnp_root_device_get_relative_location +gupnp_root_device_get_description_document_name gupnp_root_device_get_description_dir gupnp_root_device_get_description_path gupnp_root_device_get_ssdp_resource_group +gupnp_root_device_get_relative_location <SUBSECTION Standard> GUPnPRootDeviceClass GUPNP_ROOT_DEVICE @@ -430,6 +433,8 @@ GUPnPControlError GUPNP_XML_ERROR GUPnPXMLError +GUPNP_ROOT_DEVICE_ERROR +GUPnPRootDeviceError <SUBSECTION Private> gupnp_server_error_quark gupnp_eventing_error_quark @@ -492,6 +497,25 @@ </SECTION> <SECTION> +<FILE>gupnp-context-filter</FILE> +<TITLE>GUPnPContextFilter</TITLE> +GUPnPContextFilter +GUPnPContextFilterClass +gupnp_context_filter_add_entry +gupnp_context_filter_add_entryv +gupnp_context_filter_check_context +gupnp_context_filter_clear +gupnp_context_filter_get_enabled +gupnp_context_filter_get_entries +gupnp_context_filter_is_empty +gupnp_context_filter_remove_entry +gupnp_context_filter_set_enabled +gupnp_context_manager_get_context_filter +<SUBSECTION Standard> +GUPNP_TYPE_CONTEXT_FILTER +</SECTION> + +<SECTION> <FILE>gupnp-white-list</FILE> <TITLE>GUPnPWhiteList</TITLE> GUPnPWhiteList diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/doc/meson.build new/gupnp-1.4.2/doc/meson.build --- old/gupnp-1.4.1/doc/meson.build 2021-12-06 18:48:24.981335900 +0100 +++ new/gupnp-1.4.2/doc/meson.build 2022-01-08 11:01:21.196516000 +0100 @@ -66,6 +66,7 @@ xsltproc, xlstproc_flags, '--noout', + '--nowrite', stylesheet, 'gupnp-binding-tool.xml' ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/examples/light-server.c new/gupnp-1.4.2/examples/light-server.c --- old/gupnp-1.4.1/examples/light-server.c 2021-12-06 18:48:24.984336100 +0100 +++ new/gupnp-1.4.2/examples/light-server.c 2022-01-08 11:01:21.197516000 +0100 @@ -69,7 +69,7 @@ } /* Return success to the client */ - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } /* GetTarget */ @@ -81,7 +81,7 @@ gupnp_service_action_set (action, "RetTargetValue", G_TYPE_BOOLEAN, status, NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } /* GetStatus */ @@ -93,7 +93,7 @@ gupnp_service_action_set (action, "ResultStatus", G_TYPE_BOOLEAN, status, NULL); - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-context-manager.c new/gupnp-1.4.2/libgupnp/gupnp-context-manager.c --- old/gupnp-1.4.1/libgupnp/gupnp-context-manager.c 2021-12-06 18:48:24.990336200 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-context-manager.c 2022-01-08 11:01:21.200516000 +0100 @@ -183,7 +183,9 @@ GUPnPControlPoint *cp; cp = GUPNP_CONTROL_POINT (l->data); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS obj_context = gupnp_control_point_get_context (cp); + G_GNUC_END_IGNORE_DEPRECATIONS } else if (GUPNP_IS_ROOT_DEVICE (l->data)) { GUPnPDeviceInfo *info; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-context.c new/gupnp-1.4.2/libgupnp/gupnp-context.c --- old/gupnp-1.4.1/libgupnp/gupnp-context.c 2021-12-06 18:48:24.990336200 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-context.c 2022-01-08 11:01:21.200516000 +0100 @@ -330,6 +330,7 @@ } g_clear_object (&priv->server); + g_clear_object (&priv->acl); /* Call super */ object_class = G_OBJECT_CLASS (gupnp_context_parent_class); @@ -1243,6 +1244,9 @@ * Start hosting @local_path at @server_path. Files with the path * @local_path.LOCALE (if they exist) will be served up when LOCALE is * specified in the request's Accept-Language header. + * + * @note: Paths added to the HTTP server using gupnp_context_host_path() + * are not subject to handling by #GUPnPAcl. **/ void gupnp_context_host_path (GUPnPContext *context, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-control-point.c new/gupnp-1.4.2/libgupnp/gupnp-control-point.c --- old/gupnp-1.4.1/libgupnp/gupnp-control-point.c 2021-12-06 18:48:24.991336000 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-control-point.c 2022-01-08 11:01:21.201516200 +0100 @@ -87,8 +87,9 @@ GUPnPContext *context; SoupSession *session; - + G_GNUC_BEGIN_IGNORE_DEPRECATIONS context = gupnp_control_point_get_context (data->control_point); + G_GNUC_END_IGNORE_DEPRECATIONS session = gupnp_context_get_session (context); soup_session_cancel_message (session, @@ -303,7 +304,9 @@ priv = gupnp_control_point_get_instance_private (control_point); factory = gupnp_control_point_get_resource_factory (control_point); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS context = gupnp_control_point_get_context (control_point); + G_GNUC_END_IGNORE_DEPRECATIONS /* Create proxy */ proxy = gupnp_resource_factory_create_service_proxy (factory, @@ -342,7 +345,9 @@ priv = gupnp_control_point_get_instance_private (control_point); factory = gupnp_control_point_get_resource_factory (control_point); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS context = gupnp_control_point_get_context (control_point); + G_GNUC_END_IGNORE_DEPRECATIONS proxy = gupnp_resource_factory_create_device_proxy (factory, context, @@ -700,7 +705,9 @@ GetDescriptionURLData *data; char *local_description = NULL; + G_GNUC_BEGIN_IGNORE_DEPRECATIONS context = gupnp_control_point_get_context (control_point); + G_GNUC_END_IGNORE_DEPRECATIONS session = gupnp_context_get_session (context); @@ -1191,6 +1198,7 @@ * Get the #GUPnPControlPoint associated with @control_point. * * Returns: (transfer none): The #GUPnPContext. + * Deprecated: 1.4.1: Use gssdp_resource_browser_get_client() instead. **/ GUPnPContext * gupnp_control_point_get_context (GUPnPControlPoint *control_point) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-control-point.h new/gupnp-1.4.2/libgupnp/gupnp-control-point.h --- old/gupnp-1.4.1/libgupnp/gupnp-control-point.h 2021-12-06 18:48:24.991336000 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-control-point.h 2022-01-08 11:01:21.201516200 +0100 @@ -58,7 +58,7 @@ GUPnPResourceFactory *factory, const char *target); -GUPnPContext * +G_DEPRECATED_FOR (gssdp_resource_browser_get_client) GUPnPContext * gupnp_control_point_get_context (GUPnPControlPoint *control_point); const GList * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-device-info-private.h new/gupnp-1.4.2/libgupnp/gupnp-device-info-private.h --- old/gupnp-1.4.1/libgupnp/gupnp-device-info-private.h 2021-12-06 18:48:24.991336000 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-device-info-private.h 2022-01-08 11:01:21.201516200 +0100 @@ -15,4 +15,7 @@ G_GNUC_INTERNAL GUPnPXMLDoc * _gupnp_device_info_get_document (GUPnPDeviceInfo *info); +G_GNUC_INTERNAL void +_gupnp_device_info_set_document (GUPnPDeviceInfo *info, GUPnPXMLDoc *doc); + #endif /* GUPNP_DEVICE_INFO_PRIVATE_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-device-info.c new/gupnp-1.4.2/libgupnp/gupnp-device-info.c --- old/gupnp-1.4.1/libgupnp/gupnp-device-info.c 2021-12-06 18:48:24.991336000 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-device-info.c 2022-01-08 11:01:21.201516200 +0100 @@ -310,19 +310,18 @@ * * Stability: Private **/ - g_object_class_install_property - (object_class, - PROP_DOCUMENT, - g_param_spec_object ("document", - "Document", - "The XML document related to this " - "device", - GUPNP_TYPE_XML_DOC, - G_PARAM_READWRITE | - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_NAME | - G_PARAM_STATIC_NICK | - G_PARAM_STATIC_BLURB)); + g_object_class_install_property ( + object_class, + PROP_DOCUMENT, + g_param_spec_object ("document", + "Document", + "The XML document related to this " + "device", + GUPNP_TYPE_XML_DOC, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT | + G_PARAM_STATIC_NAME | + G_PARAM_STATIC_NICK | + G_PARAM_STATIC_BLURB)); /** * GUPnPDeviceInfo:element: @@ -1466,3 +1465,13 @@ return priv->doc; } + +void +_gupnp_device_info_set_document (GUPnPDeviceInfo *info, GUPnPXMLDoc *doc) +{ + GUPnPDeviceInfoPrivate *priv; + + priv = gupnp_device_info_get_instance_private (info); + + priv->doc = g_object_ref (doc); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-resource-factory.c new/gupnp-1.4.2/libgupnp/gupnp-resource-factory.c --- old/gupnp-1.4.1/libgupnp/gupnp-resource-factory.c 2021-12-06 18:48:24.994336100 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-resource-factory.c 2022-01-08 11:01:21.204516200 +0100 @@ -25,6 +25,7 @@ #include <config.h> #include <string.h> +#include "gupnp-device-info-private.h" #include "gupnp-resource-factory-private.h" #include "gupnp-root-device.h" @@ -338,14 +339,25 @@ element, GUPNP_TYPE_DEVICE); + GUPnPXMLDoc *doc = _gupnp_device_info_get_document ( + GUPNP_DEVICE_INFO (root_device)); device = g_object_new (device_type, - "resource-factory", factory, - "context", context, - "root-device", root_device, - "location", location, - "udn", udn, - "url-base", url_base, - "element", element, + "resource-factory", + factory, + "context", + context, + "root-device", + root_device, + "location", + location, + "udn", + udn, + "url-base", + url_base, + "document", + doc, + "element", + element, NULL); return device; @@ -395,13 +407,23 @@ element, GUPNP_TYPE_SERVICE); + GUPnPXMLDoc *doc = _gupnp_device_info_get_document ( + GUPNP_DEVICE_INFO (root_device)); service = g_object_new (service_type, - "context", context, - "root-device", root_device, - "location", location, - "udn", udn, - "url-base", url_base, - "element", element, + "context", + context, + "root-device", + root_device, + "location", + location, + "udn", + udn, + "url-base", + url_base, + "document", + doc, + "element", + element, NULL); return service; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-root-device.c new/gupnp-1.4.2/libgupnp/gupnp-root-device.c --- old/gupnp-1.4.1/libgupnp/gupnp-root-device.c 2021-12-06 18:48:24.994336100 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-root-device.c 2022-01-08 11:01:21.204516200 +0100 @@ -19,9 +19,10 @@ #include <libgssdp/gssdp-resource-group.h> -#include "gupnp-root-device.h" #include "gupnp-context-private.h" +#include "gupnp-device-info-private.h" #include "gupnp-error.h" +#include "gupnp-root-device.h" #include "http-headers.h" #include "xml-util.h" @@ -35,8 +36,6 @@ GError **error); struct _GUPnPRootDevicePrivate { - GUPnPXMLDoc *description_doc; - GSSDPResourceGroup *group; char *description_path; @@ -72,7 +71,6 @@ device = GUPNP_ROOT_DEVICE (object); priv = gupnp_root_device_get_instance_private (device); - g_clear_object (&priv->description_doc); g_free (priv->description_path); g_free (priv->description_dir); g_free (priv->relative_location); @@ -129,7 +127,10 @@ switch (property_id) { case PROP_DESCRIPTION_DOC: - priv->description_doc = g_value_dup_object (value); + if (g_value_get_object (value) != NULL) + _gupnp_device_info_set_document ( + GUPNP_DEVICE_INFO (device), + g_value_get_object (value)); break; case PROP_DESCRIPTION_PATH: priv->description_path = g_value_dup_string (value); @@ -345,11 +346,13 @@ priv->description_path, NULL); + GUPnPXMLDoc *description_doc = + _gupnp_device_info_get_document (GUPNP_DEVICE_INFO (device)); /* Check whether we have a parsed description document */ - if (priv->description_doc == NULL) { + if (description_doc == NULL) { /* We don't, so load and parse it */ - priv->description_doc = load_and_parse (desc_path); - if (priv->description_doc == NULL) { + description_doc = load_and_parse (desc_path); + if (description_doc == NULL) { g_set_error_literal (error, GUPNP_XML_ERROR, GUPNP_XML_ERROR_PARSE, @@ -357,13 +360,15 @@ goto DONE; } + } else { + g_object_ref (description_doc); } /* Find correct element */ - root_element = xml_util_get_element ((xmlNode *) - gupnp_xml_doc_get_doc (priv->description_doc), - "root", - NULL); + root_element = xml_util_get_element ( + (xmlNode *) gupnp_xml_doc_get_doc (description_doc), + "root", + NULL); if (!root_element) { g_set_error_literal (error, GUPNP_XML_ERROR, @@ -420,8 +425,12 @@ /* Set additional properties */ g_object_set (G_OBJECT (device), - "location", location, - "url-base", url_base, + "location", + location, + "url-base", + url_base, + "document", + description_doc, NULL); soup_uri_free (url_base); @@ -446,6 +455,8 @@ if (uri) soup_uri_free (uri); + g_clear_object (&description_doc); + g_free (desc_path); g_free (location); @@ -470,6 +481,7 @@ * Device description document. Constructor property. * * Since: 0.14.0 + * Deprecated: 1.14.2: Use GUPnPDeviceInfo::document instead **/ g_object_class_install_property (object_class, @@ -605,12 +617,18 @@ return g_initable_new (GUPNP_TYPE_ROOT_DEVICE, NULL, error, - "context", context, - "resource-factory", factory, - "root-device", NULL, - "description-doc", description_doc, - "description-path", description_path, - "description-dir", description_dir, + "context", + context, + "resource-factory", + factory, + "root-device", + NULL, + "document", + description_doc, + "description-path", + description_path, + "description-dir", + description_dir, NULL); } @@ -664,10 +682,25 @@ * Get the relative location of @root_device. * * Return value: The relative location of @root_device. + * Deprecated: 1.4.2: Use gupnp_root_device_get_description_document_name() instead. **/ const char * gupnp_root_device_get_relative_location (GUPnPRootDevice *root_device) { + return gupnp_root_device_get_description_document_name (root_device); +} + +/** + * gupnp_root_device_get_description_document_name: + * @root_device: A #GUPnPRootDevice + * + * Gets the name of the description document as hosted via HTTP. + * + * Return value: The relative location of @root_device. + **/ +const char * +gupnp_root_device_get_description_document_name (GUPnPRootDevice *root_device) +{ GUPnPRootDevicePrivate *priv; g_return_val_if_fail (GUPNP_IS_ROOT_DEVICE (root_device), NULL); @@ -677,6 +710,7 @@ return priv->relative_location; } + /** * gupnp_root_device_get_description_path: * @root_device: A #GUPnPRootDevice diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-root-device.h new/gupnp-1.4.2/libgupnp/gupnp-root-device.h --- old/gupnp-1.4.1/libgupnp/gupnp-root-device.h 2021-12-06 18:48:24.994336100 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-root-device.h 2022-01-08 11:01:21.204516200 +0100 @@ -62,6 +62,10 @@ gupnp_root_device_get_available (GUPnPRootDevice *root_device); const char * +gupnp_root_device_get_description_document_name + (GUPnPRootDevice *root_device); + +G_GNUC_DEPRECATED_FOR (gupnp_root_device_get_description_document_name) const char * gupnp_root_device_get_relative_location (GUPnPRootDevice *root_device); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-service-proxy-action.c new/gupnp-1.4.2/libgupnp/gupnp-service-proxy-action.c --- old/gupnp-1.4.1/libgupnp/gupnp-service-proxy-action.c 2021-12-06 18:48:24.996336200 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-service-proxy-action.c 2022-01-08 11:01:21.205516000 +0100 @@ -78,6 +78,7 @@ switch (action->msg->status_code) { case SOUP_STATUS_OK: case SOUP_STATUS_INTERNAL_SERVER_ERROR: + // This indicates a SOAP error that needs to be evaluated break; default: _gupnp_error_set_server_error (error, action->msg); @@ -96,6 +97,7 @@ GUPNP_SERVER_ERROR_INVALID_RESPONSE, "Could not parse SOAP response"); } else { + // INTERNALL_SERVER_ERROR was not a SOAP error but something else g_set_error_literal (error, GUPNP_SERVER_ERROR, @@ -776,6 +778,20 @@ return result; } +/** + * gupnp_service_proxy_action_set: + * @action: the action to modify + * @key: the name of the value to modify + * @value: the new value of @key + * @error: (nullable): a return location for an #GError + * + * Update the value of @key to @value. + * + * @key needs to already exist in @action. + * + * Returns: true if successfully modified, false otherwise + * Since: 1.4.0 + */ gboolean gupnp_service_proxy_action_set (GUPnPServiceProxyAction *action, const char *key, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-service-proxy.c new/gupnp-1.4.2/libgupnp/gupnp-service-proxy.c --- old/gupnp-1.4.1/libgupnp/gupnp-service-proxy.c 2021-12-06 18:48:24.996336200 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-service-proxy.c 2022-01-08 11:01:21.206516300 +0100 @@ -721,6 +721,9 @@ } static void +gupnp_service_proxy_action_queue_task (GTask *task); + +static void action_task_got_response (SoupSession *session, SoupMessage *msg, gpointer user_data) @@ -728,43 +731,39 @@ GTask *task = G_TASK (user_data); GUPnPServiceProxyAction *action = (GUPnPServiceProxyAction *) g_task_get_task_data (task); - switch (msg->status_code) { - case SOUP_STATUS_CANCELLED: - if (action->cancellable != NULL && action->cancellable_connection_id != 0) { - g_cancellable_disconnect (action->cancellable, - action->cancellable_connection_id); - action->cancellable_connection_id = 0; - } + // Re-send the message with method M-POST and s-SOAPAction + if (msg->status_code == SOUP_STATUS_METHOD_NOT_ALLOWED && + g_str_equal ("POST", msg->method)) { + update_message_after_not_allowed (msg); + gupnp_service_proxy_action_queue_task (task); + + return; + } + + if (action->cancellable != NULL && action->cancellable_connection_id != 0) { + g_cancellable_disconnect (action->cancellable, + action->cancellable_connection_id); + action->cancellable_connection_id = 0; + } + if (SOUP_STATUS_IS_TRANSPORT_ERROR (msg->status_code)) { + g_task_return_new_error ( + task, + GUPNP_SERVER_ERROR, + GUPNP_SERVER_ERROR_OTHER, + "Server does not allow any POST messages"); + } else if (msg->status_code == SOUP_STATUS_CANCELLED) { g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Action message was cancelled"); - g_object_unref (task); - break; - - case SOUP_STATUS_METHOD_NOT_ALLOWED: - /* And re-queue */ - update_message_after_not_allowed (msg); - soup_session_requeue_message (session, msg); - - break; - - default: - if (action->cancellable != NULL && action->cancellable_connection_id != 0) { - g_cancellable_disconnect (action->cancellable, - action->cancellable_connection_id); - action->cancellable_connection_id = 0; - } - + } else { g_task_return_pointer (task, g_task_get_task_data (task), - (GDestroyNotify) gupnp_service_proxy_action_unref); - - g_object_unref (task); - - break; + NULL); } + + g_object_unref (task); } static void @@ -2102,6 +2101,9 @@ * Finish an asynchronous call initiated with * gupnp_service_proxy_call_action_async(). * + * Note: This will only signalize transport errors to the caller, such as the action being cancelled + * or lost connection etc. SOAP call errors are only returned by gupnp_service_proxy_action_get() and such. + * * Returns: (nullable) (transfer none): %NULL, if the call had an error, the action otherwise. * Since: 1.2.0 */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-service-proxy.h new/gupnp-1.4.2/libgupnp/gupnp-service-proxy.h --- old/gupnp-1.4.1/libgupnp/gupnp-service-proxy.h 2021-12-06 18:48:24.996336200 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-service-proxy.h 2022-01-08 11:01:21.206516300 +0100 @@ -217,6 +217,12 @@ gupnp_service_proxy_action_unref) gboolean +gupnp_service_proxy_action_set (GUPnPServiceProxyAction *action, + const char *key, + const GValue *value, + GError **error); + +gboolean gupnp_service_proxy_action_get_result (GUPnPServiceProxyAction *action, GError **error, ...) G_GNUC_NULL_TERMINATED; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-service.c new/gupnp-1.4.2/libgupnp/gupnp-service.c --- old/gupnp-1.4.1/libgupnp/gupnp-service.c 2021-12-06 18:48:24.997336100 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-service.c 2022-01-08 11:01:21.206516300 +0100 @@ -365,7 +365,9 @@ g_return_if_fail (action != NULL); va_start (var_args, action); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS gupnp_service_action_get_valist (action, var_args); + G_GNUC_END_IGNORE_DEPRECATIONS va_end (var_args); } @@ -557,7 +559,9 @@ g_return_if_fail (action != NULL); va_start (var_args, action); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS gupnp_service_action_set_valist (action, var_args); + G_GNUC_END_IGNORE_DEPRECATIONS va_end (var_args); } @@ -690,10 +694,23 @@ * @action: A #GUPnPServiceAction * * Return succesfully. + * Deprecated: 1.4.2: Use gupnp_service_action_return_success() instead **/ void gupnp_service_action_return (GUPnPServiceAction *action) { + gupnp_service_action_return_success (action); +} + +/** + * gupnp_service_action_return_success: + * @action: A #GUPnPServiceAction + * + * Return succesfully. + **/ +void +gupnp_service_action_return_success (GUPnPServiceAction *action) +{ g_return_if_fail (action != NULL); soup_message_set_status (action->msg, SOUP_STATUS_OK); @@ -898,7 +915,7 @@ xmlFree (var_name); } - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } /* controlURL handler */ @@ -1872,7 +1889,9 @@ g_return_if_fail (GUPNP_IS_SERVICE (service)); va_start (var_args, service); + G_GNUC_BEGIN_IGNORE_DEPRECATIONS gupnp_service_notify_valist (service, var_args); + G_GNUC_END_IGNORE_DEPRECATIONS va_end (var_args); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-service.h new/gupnp-1.4.2/libgupnp/gupnp-service.h --- old/gupnp-1.4.1/libgupnp/gupnp-service.h 2021-12-06 18:48:24.997336100 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-service.h 2022-01-08 11:01:21.206516300 +0100 @@ -69,7 +69,7 @@ gupnp_service_action_get (GUPnPServiceAction *action, ...) G_GNUC_NULL_TERMINATED; -void +G_DEPRECATED void gupnp_service_action_get_valist (GUPnPServiceAction *action, va_list var_args); @@ -92,7 +92,7 @@ gupnp_service_action_set (GUPnPServiceAction *action, ...) G_GNUC_NULL_TERMINATED; -void +G_DEPRECATED void gupnp_service_action_set_valist (GUPnPServiceAction *action, va_list var_args); @@ -106,8 +106,11 @@ const char *argument, const GValue *value); +G_DEPRECATED_FOR (gupnp_service_action_return_success) +void gupnp_service_action_return (GUPnPServiceAction *action); + void -gupnp_service_action_return (GUPnPServiceAction *action); +gupnp_service_action_return_success (GUPnPServiceAction *action); void gupnp_service_action_return_error (GUPnPServiceAction *action, @@ -125,7 +128,7 @@ gupnp_service_notify (GUPnPService *service, ...) G_GNUC_NULL_TERMINATED; -void +G_DEPRECATED void gupnp_service_notify_valist (GUPnPService *service, va_list var_args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/libgupnp/gupnp-white-list.c new/gupnp-1.4.2/libgupnp/gupnp-white-list.c --- old/gupnp-1.4.1/libgupnp/gupnp-white-list.c 2021-12-06 18:48:24.998336300 +0100 +++ new/gupnp-1.4.2/libgupnp/gupnp-white-list.c 2022-01-08 11:01:21.207516200 +0100 @@ -9,9 +9,21 @@ /** * SECTION:gupnp-white-list - * @short_description: Class for network filtering. + * @short_description: Deprecated network filtering + */ + +#include <config.h> +#include <string.h> + +#include "gupnp-white-list.h" +#include "gupnp-context-filter.h" + +/** + * GUPnPWhiteList: + * + * Utility class for context filtering in the context manager. * - * #GUPnPWhiteList handles network filtering. It provides API to manage a list + * It provides API to manage a list * of entries that will be used to filter networks. * The #GUPnPWhiteList could be enabled or not. If it's enabled but the entries * list is empty, it behaves as disabled. @@ -20,12 +32,6 @@ * Deprecated: 1.4.0: Use #GUPnPContextFilter */ -#include <config.h> -#include <string.h> - -#include "gupnp-white-list.h" -#include "gupnp-context-filter.h" - /** * gupnp_white_list_new: * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/meson.build new/gupnp-1.4.2/meson.build --- old/gupnp-1.4.1/meson.build 2021-12-06 18:48:24.999336200 +0100 +++ new/gupnp-1.4.2/meson.build 2022-01-08 11:01:21.209516300 +0100 @@ -1,4 +1,4 @@ -project('gupnp', 'c', version : '1.4.1', meson_version : '>= 0.54.0') +project('gupnp', 'c', version : '1.4.2', meson_version : '>= 0.54.0') gnome = import('gnome') pkg = import('pkgconfig') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gupnp-1.4.1/tests/test-bugs.c new/gupnp-1.4.2/tests/test-bugs.c --- old/gupnp-1.4.1/tests/test-bugs.c 2021-12-06 18:48:25.000336200 +0100 +++ new/gupnp-1.4.2/tests/test-bugs.c 2022-01-08 11:01:21.210516200 +0100 @@ -6,14 +6,14 @@ * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #include <libgupnp/gupnp.h> #include <libgupnp/gupnp-service-private.h> #include <libgupnp/gupnp-context-private.h> +#include <libgssdp/gssdp-resource-group.h> +#include <libsoup/soup.h> + + static GUPnPContext * create_context (guint16 port, GError **error) { return GUPNP_CONTEXT (g_initable_new (GUPNP_TYPE_CONTEXT, @@ -90,7 +90,7 @@ g_assert (node != NULL); g_assert_cmpstr ((const char *) node->name, ==, "SortCriteria"); node = node->next; - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } static void @@ -173,11 +173,19 @@ static void test_run_loop (GMainLoop *loop) { - guint timeout_id = 0; + guint timeout_id = 0; + int timeout = 2; - timeout_id = g_timeout_add_seconds (2, test_on_timeout, NULL); - g_main_loop_run (loop); - g_source_remove (timeout_id); + const char *timeout_str = g_getenv ("GUPNP_TEST_TIMEOUT"); + if (timeout_str != NULL) { + long t = atol (timeout_str); + if (t != 0) + timeout = t; + } + + timeout_id = g_timeout_add_seconds (timeout, test_on_timeout, NULL); + g_main_loop_run (loop); + g_source_remove (timeout_id); } /* Test if a call on a service proxy keeps argument order */ @@ -544,7 +552,7 @@ GUPnPServiceAction *action, gpointer user_data) { - gupnp_service_action_return (action); + gupnp_service_action_return_success (action); } static void @@ -660,6 +668,249 @@ g_main_loop_unref (data.loop); } +void +test_ggo_42 () +{ + GUPnPContext *context = NULL; + GError *error = NULL; + GUPnPRootDevice *rd; + GUPnPServiceInfo *info = NULL; + + context = create_context (0, &error); + g_assert_no_error (error); + g_assert (context != NULL); + + 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_object_unref (rd); + g_object_unref (info); +} + +void +on_control (SoupServer *server, + SoupMessage *msg, + const char *path, + GHashTable *query, + SoupClientContext *ctx, + gpointer user_data) +{ + g_print ("Method: %s\n", msg->method); + soup_message_set_status (msg, SOUP_STATUS_METHOD_NOT_ALLOWED); +} + +void +on_event (SoupServer *server, + SoupMessage *msg, + const char *path, + GHashTable *query, + SoupClientContext *ctx, + gpointer user_data) +{ + soup_message_set_status (msg, SOUP_STATUS_OK); +} + +typedef struct { + GUPnPServiceProxy *p; + GMainLoop *loop; +} TestGGO63Data; + +void +on_proxy (GUPnPControlPoint *cp, GUPnPServiceProxy *p, gpointer user_data) +{ + g_print ("Got proxy....\n"); + TestGGO63Data *d = (TestGGO63Data *) user_data; + d->p = g_object_ref (p); + + g_main_loop_quit (d->loop); +} + +void +on_ping (GObject *object, GAsyncResult *res, gpointer user_data) +{ + TestGGO63Data *d = (TestGGO63Data *) user_data; + GError *error = NULL; + + GUPnPServiceProxyAction *action = + gupnp_service_proxy_call_action_finish ( + GUPNP_SERVICE_PROXY (object), + res, + &error); + + g_assert_nonnull (action); + g_assert_no_error (error); + + gupnp_service_proxy_action_get_result (action, &error, NULL); + g_assert_error (error, GUPNP_SERVER_ERROR, GUPNP_SERVER_ERROR_OTHER); + + g_error_free (error); + + g_main_loop_quit (d->loop); +} + +void +test_ggo_63 () +{ + GUPnPContext *context = NULL; + GError *error = NULL; + + context = create_context (0, &error); + g_assert_no_error (error); + g_assert (context != NULL); + + SoupServer *server = gupnp_context_get_server (context); + GSList *uris = soup_server_get_uris (server); + GSSDPResourceGroup *rg = + gssdp_resource_group_new (GSSDP_CLIENT (context)); + + char *server_uri = soup_uri_to_string (uris->data, FALSE); + char *resource_path = g_strconcat (server_uri, "TestDevice.xml", NULL); + g_free (server_uri); + g_slist_free_full (uris, (GDestroyNotify) soup_uri_free); + + gssdp_resource_group_add_resource_simple (rg, + "upnp:rootdevice", + "uuid:1234::upnp:rootdevice", + resource_path); + + gssdp_resource_group_add_resource_simple (rg, + "uuid:1234", + "uuid:1234", + resource_path); + + gssdp_resource_group_add_resource_simple ( + rg, + "urn:test-gupnp-org:device:TestDevice:1", + "uuid:1234::urn:test-gupnp-org:device:TestDevice:1", + resource_path); + + gssdp_resource_group_add_resource_simple ( + rg, + "urn:test-gupnp-org:service:TestService:1", + "uuid:1234::urn:test-gupnp-org:service:TestService:1", + resource_path); + + g_free (resource_path); + + gupnp_context_host_path (context, + DATA_PATH "/TestDevice.xml", + "/TestDevice.xml"); + + soup_server_add_handler (server, + "/TestService/Control", + on_control, + NULL, + NULL); + + soup_server_add_handler (server, + "/TestService/Event", + on_event, + NULL, + NULL); + + gssdp_resource_group_set_available (rg, TRUE); + + + GUPnPControlPoint *cp = gupnp_control_point_new ( + context, + "urn:test-gupnp-org:service:TestService:1"); + + TestGGO63Data d = { .loop = g_main_loop_new (NULL, FALSE), .p = NULL }; + g_signal_connect (G_OBJECT (cp), + "service-proxy-available", + G_CALLBACK (on_proxy), + &d); + + gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE); + + g_main_loop_run (d.loop); + + GUPnPServiceProxyAction *a = + gupnp_service_proxy_action_new ("Ping", NULL); + + gupnp_service_proxy_call_action_async (d.p, a, NULL, on_ping, &d); + + g_main_loop_run (d.loop); + gupnp_service_proxy_action_unref (a); + + g_object_unref (d.p); + g_object_unref (cp); + g_object_unref (rg); + g_object_unref (context); + g_main_loop_unref (d.loop); +} + +void +test_ggo_60_call_ready (GObject *source, GAsyncResult *res, gpointer user_data) +{ + g_main_loop_quit ((GMainLoop *) user_data); +} + +void +test_ggo_60_no_crash () +{ + // Test that there is no crash if not calling call_finish() on call_async() + GUPnPContext *context = NULL; + GError *error = NULL; + GUPnPControlPoint *cp = NULL; + GUPnPRootDevice *rd; + TestServiceProxyData data = { .proxy = NULL, + .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); + test_run_loop (data.loop); + g_assert (data.proxy != NULL); + + // We just use the default of "Action not implemented" response, since + // it does not matter for the actual test + + GUPnPServiceProxyAction *action = + gupnp_service_proxy_action_new ("Ping", NULL); + gupnp_service_proxy_call_action_async (data.proxy, + action, + NULL, + test_ggo_60_call_ready, + data.loop); + + test_run_loop (data.loop); + gupnp_service_proxy_action_unref (action); + g_object_unref (data.proxy); + g_object_unref (rd); + g_object_unref (cp); + g_object_unref (context); + g_main_loop_unref (data.loop); +} + int main (int argc, char *argv[]) { g_test_init (&argc, &argv, NULL); @@ -670,6 +921,9 @@ 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); + g_test_add_func ("/bugs/ggo/42", test_ggo_42); + g_test_add_func ("/bugs/ggo/63", test_ggo_63); + g_test_add_func ("/bugs/ggo/60/no-crash", test_ggo_60_no_crash); return g_test_run (); } ++++++ gupnp-build-man-pages.patch ++++++ --- orig-gupnp-1.4.2/doc/meson.build 2022-01-08 11:01:21.196516000 +0100 +++ gupnp-1.4.2/doc/meson.build 2022-01-08 13:13:33.498056150 +0100 @@ -66,7 +66,6 @@ xsltproc, xlstproc_flags, '--noout', - '--nowrite', stylesheet, 'gupnp-binding-tool.xml' ]