From 5d1ae2f08e79806385d306d70e4b8021649fab46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 30 Jun 2010 18:07:20 +0000 Subject: [PATCH] Announce HTTP server over mdns too --- src/avahi.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/avahi.c b/src/avahi.c index 6faad263..ae32decc 100644 --- a/src/avahi.c +++ b/src/avahi.c @@ -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",