[gupnp-tools/wip/new-upnp] all: Port to new GUPnP API



commit a77e346326766441513e1bb363dfe859fa5d4783
Author: Jens Georg <mail jensge org>
Date:   Sun Oct 16 21:54:15 2016 +0200

    all: Port to new GUPnP API
    
    Signed-off-by: Jens Georg <mail jensge org>

 configure.ac                     |    8 ++++----
 src/discover/gssdp-discover.c    |    2 +-
 src/network-light/upnp.c         |   10 +++++++++-
 src/universal-cp/action-dialog.c |    4 ++--
 src/upload/main.c                |    2 +-
 5 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 21ae201..915a508 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,8 +29,8 @@ LT_PREREQ([2.2])
 LT_INIT([])
 
 GLIB_REQUIRED=2.24
-GSSDP_REQUIRED=0.13.3
-GUPNP_REQUIRED=0.20.14
+GSSDP_REQUIRED=1.1.0
+GUPNP_REQUIRED=1.1.0
 SOUP_REQUIRED=2.42
 GUPNP_AV_REQUIRED=0.5.5
 GTK_REQUIRED=3.10
@@ -50,8 +50,8 @@ esac
 AC_MSG_RESULT([$os_win32])
 AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes])
 
-PKG_CHECK_MODULES(LIBGSSDP, gssdp-1.0 >= $GSSDP_REQUIRED)
-PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.0 >= $GUPNP_REQUIRED)
+PKG_CHECK_MODULES(LIBGSSDP, gssdp-1.2 >= $GSSDP_REQUIRED)
+PKG_CHECK_MODULES(LIBGUPNP, gupnp-1.2 >= $GUPNP_REQUIRED)
 PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $SOUP_REQUIRED)
 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED)
 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)
diff --git a/src/discover/gssdp-discover.c b/src/discover/gssdp-discover.c
index e2b4656..9eef525 100644
--- a/src/discover/gssdp-discover.c
+++ b/src/discover/gssdp-discover.c
@@ -102,7 +102,7 @@ int main (int argc, char *argv[]) {
 
         g_option_context_free (context);
 
-        discover.client = gssdp_client_new (NULL, interface, &error);
+        discover.client = gssdp_client_new (interface, &error);
         if (error != NULL) {
                 g_warning ("Failed to create GSSDP client: %s", error->message);
                 g_error_free (error);
diff --git a/src/network-light/upnp.c b/src/network-light/upnp.c
index e913028..91f3268 100644
--- a/src/network-light/upnp.c
+++ b/src/network-light/upnp.c
@@ -585,7 +585,15 @@ init_server (GUPnPContext *context)
                                           gupnp_resource_factory_get_default (),
                                           doc,
                                           desc_location,
-                                          DATA_DIR);
+                                          DATA_DIR,
+                                          &error);
+        if (error != NULL) {
+                g_warning ("Failed to create root device: %s",
+                           error->message);
+                g_error_free (error);
+
+                return FALSE;
+        }
 
         switch_power = gupnp_device_info_get_service (GUPNP_DEVICE_INFO (dev),
                                                       SWITCH_SERVICE);
diff --git a/src/universal-cp/action-dialog.c b/src/universal-cp/action-dialog.c
index 481b34d..9e21af0 100644
--- a/src/universal-cp/action-dialog.c
+++ b/src/universal-cp/action-dialog.c
@@ -676,8 +676,8 @@ on_action_complete (GUPnPServiceProxy       *proxy,
 
         gupnp_service_proxy_end_action_hash (proxy,
                                              action,
-                                             &error,
-                                             out_args);
+                                             out_args,
+                                             &error);
         if (error) {
                 GtkWidget *error_dialog;
 
diff --git a/src/upload/main.c b/src/upload/main.c
index 68af215..8d6d3bb 100644
--- a/src/upload/main.c
+++ b/src/upload/main.c
@@ -174,7 +174,7 @@ main (gint   argc,
         }
 
         error = NULL;
-        upnp_context = gupnp_context_new (NULL, interface, 0, &error);
+        upnp_context = gupnp_context_new (interface, 0, &error);
         if (error) {
                 g_printerr ("Error creating the GUPnP context: %s\n",
                            error->message);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]