rygel r19 - in trunk: . src



Author: zeeshanak
Date: Tue Oct 28 20:58:25 2008
New Revision: 19
URL: http://svn.gnome.org/viewvc/rygel?rev=19&view=rev

Log:
Let the context choose the hostname/IP and port for us if not in gconf.

Modified:
   trunk/ChangeLog
   trunk/src/main.c

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Tue Oct 28 20:58:25 2008
@@ -31,7 +31,6 @@
 #define DESC_DOC "xml/description.xml"
 #define MODIFIED_DESC_DOC "gupnp-media-server.xml"
 #define GCONF_PATH "/apps/gupnp-media-server/"
-#define DEFAULT_PORT 2700
 
 static GMainLoop *main_loop;
 
@@ -79,14 +78,10 @@
         host_ip = gconf_client_get_string (gconf_client,
                                            GCONF_PATH "host-ip",
                                            &error);
-        if (host_ip == NULL) {
-                host_ip = g_strdup (g_get_host_name ());
-
-                if (error) {
-                        g_warning ("%s", error->message);
+        if (error) {
+                g_warning ("%s", error->message);
 
-                        g_error_free (error);
-                }
+                g_error_free (error);
         }
 
         error = NULL;
@@ -94,11 +89,7 @@
                                      GCONF_PATH "port",
                                      &error);
         if (error) {
-                port = DEFAULT_PORT;
-
                 g_warning ("%s", error->message);
-                g_warning ("Failed to get port from configuration."
-                           " Assuming default: %d", port);
 
                 g_error_free (error);
         }
@@ -108,7 +99,8 @@
         error = NULL;
         context = gupnp_context_new (NULL, host_ip, port, &error);
 
-        g_free (host_ip);
+        if (host_ip)
+                g_free (host_ip);
 
         if (error) {
                 g_warning ("Error setting up GUPnP context: %s",



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