]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Announce HTTP server over mdns too
authorAndreas Öman <andreas@lonelycoder.com>
Wed, 30 Jun 2010 18:07:20 +0000 (18:07 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Wed, 30 Jun 2010 18:07:20 +0000 (18:07 +0000)
src/avahi.c

index 6faad263695b498b284f5b3f15748c9471014738..ae32decc8652cac698134b7b1726e9129e1a9c4a 100644 (file)
@@ -130,7 +130,7 @@ create_services(AvahiClient *c)
   if (avahi_entry_group_is_empty(group)) {
      tvhlog(LOG_DEBUG, "AVAHI", "Adding service '%s'", name);
 
-    /* Add the service for IPP */
+    /* Add the service for HTSP */
     if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, 
                                             AVAHI_PROTO_UNSPEC, 0, name, 
                                             "_htsp._tcp", NULL, NULL, 9982,
@@ -145,6 +145,23 @@ create_services(AvahiClient *c)
       goto fail;
     }
 
+
+    /* 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, 9981,
+                                            "path=/",
+                                            NULL)) < 0) {
+
+      if (ret == AVAHI_ERR_COLLISION)
+       goto collision;
+
+      tvhlog(LOG_ERR, "AVAHI",
+            "Failed to add _http._tcp service: %s", 
+            avahi_strerror(ret));
+      goto fail;
+    }
+
     /* Tell the server to register the service */
     if ((ret = avahi_entry_group_commit(group)) < 0) {
       tvhlog(LOG_ERR, "AVAHI",