Announce HTTP server over mdns too

This commit is contained in:
Andreas Öman 2010-06-30 18:07:20 +00:00
parent b10f84467d
commit 5d1ae2f08e

View 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",