From: Damjan Marion Date: Mon, 2 Jun 2014 07:24:20 +0000 (+0200) Subject: avahi: webroot is not fixed X-Git-Tag: v4.1~2009^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=556d9875a34f02d460ff2c61daaadd6381726ab0;p=thirdparty%2Ftvheadend.git avahi: webroot is not fixed --- diff --git a/src/avahi.c b/src/avahi.c index c84a2f218..d9e512b06 100644 --- a/src/avahi.c +++ b/src/avahi.c @@ -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;