]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
avahi: webroot is not fixed 412/head
authorDamjan Marion <damjan.marion@gmail.com>
Mon, 2 Jun 2014 07:24:20 +0000 (09:24 +0200)
committerDamjan Marion <damjan.marion@gmail.com>
Mon, 2 Jun 2014 12:28:28 +0000 (14:28 +0200)
src/avahi.c

index c84a2f2184de42f887bbdb91776776cbd549299f..d9e512b065ab2185bf989ce4969e515872a8b009 100644 (file)
@@ -112,6 +112,7 @@ static void
 create_services(AvahiClient *c) 
 {
   char *n;
+  char *path;
   int ret;
   assert(c);
 
@@ -147,14 +148,18 @@ create_services(AvahiClient *c)
       goto fail;
     }
 
+    path = malloc(strlen(tvheadend_webroot) + 6);
+    sprintf(path, "path=%s", tvheadend_webroot);
 
     /* Add the service for HTTP */
     if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, 
                                             AVAHI_PROTO_UNSPEC, 0, name, 
                                             "_http._tcp", NULL, NULL, tvheadend_webui_port,
-                                            "path=/",
+                                            path,
                                             NULL)) < 0) {
 
+    free(path);
+
       if (ret == AVAHI_ERR_COLLISION)
        goto collision;