tvheadend_webroot can be NULL
This commit is contained in:
parent
556d9875a3
commit
d0343de703
2 changed files with 9 additions and 4 deletions
11
src/avahi.c
11
src/avahi.c
|
@ -148,8 +148,12 @@ create_services(AvahiClient *c)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
path = malloc(strlen(tvheadend_webroot) + 6);
|
if (tvheadend_webroot) {
|
||||||
sprintf(path, "path=%s", tvheadend_webroot);
|
path = malloc(strlen(tvheadend_webroot) + 6);
|
||||||
|
sprintf(path, "path=%s", tvheadend_webroot);
|
||||||
|
} else {
|
||||||
|
path = "/";
|
||||||
|
}
|
||||||
|
|
||||||
/* Add the service for HTTP */
|
/* Add the service for HTTP */
|
||||||
if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC,
|
if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC,
|
||||||
|
@ -158,7 +162,8 @@ create_services(AvahiClient *c)
|
||||||
path,
|
path,
|
||||||
NULL)) < 0) {
|
NULL)) < 0) {
|
||||||
|
|
||||||
free(path);
|
if (tvheadend_webroot)
|
||||||
|
free(path);
|
||||||
|
|
||||||
if (ret == AVAHI_ERR_COLLISION)
|
if (ret == AVAHI_ERR_COLLISION)
|
||||||
goto collision;
|
goto collision;
|
||||||
|
|
|
@ -104,7 +104,7 @@ void
|
||||||
bonjour_init(void)
|
bonjour_init(void)
|
||||||
{
|
{
|
||||||
txt_rec_t txt_rec_http[] = {
|
txt_rec_t txt_rec_http[] = {
|
||||||
{ "path", tvheadend_webroot },
|
{ "path", tvheadend_webroot ? tvheadend_webroot : "/" },
|
||||||
{ .key = NULL }
|
{ .key = NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue