diff --git a/src/avahi.c b/src/avahi.c index 64be541..54a4995 100644 --- a/src/avahi.c +++ b/src/avahi.c @@ -135,8 +135,9 @@ create_services(AvahiClient *c) tvhdebug(LS_AVAHI, "Adding service '%s'", name); /* Add the service for HTSP */ - if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, - AVAHI_PROTO_UNSPEC, 0, name, + if (tvheadend_htsp_port) + if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, + AVAHI_PROTO_UNSPEC, 0, name, "_htsp._tcp", NULL, NULL,tvheadend_htsp_port, NULL)) < 0) { @@ -157,8 +158,9 @@ create_services(AvahiClient *c) } /* Add the service for HTTP */ - if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, - AVAHI_PROTO_UNSPEC, 0, name, + if (tvheadend_webui_port) + if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, + AVAHI_PROTO_UNSPEC, 0, name, "_http._tcp", NULL, NULL, tvheadend_webui_port, path, NULL)) < 0) { diff --git a/src/bonjour.c b/src/bonjour.c index 5e4eb0f..af86a70 100644 --- a/src/bonjour.c +++ b/src/bonjour.c @@ -107,11 +107,13 @@ bonjour_init(void) { "path", tvheadend_webroot ? tvheadend_webroot : "/" }, { .key = NULL } }; - - bonjour_start_service(&svc_http, "_http._tcp", tvheadend_webui_port, + + if(tvheadend_webui_port) + bonjour_start_service(&svc_http, "_http._tcp", tvheadend_webui_port, txt_rec_http); - bonjour_start_service(&svc_htsp, "_htsp._tcp", tvheadend_htsp_port, NULL); + if(tvheadend_htsp_port) + bonjour_start_service(&svc_htsp, "_htsp._tcp", tvheadend_htsp_port, NULL); } void diff --git a/src/htsp_server.c b/src/htsp_server.c index cd8a973..34c1ed8 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -3495,7 +3495,8 @@ htsp_init(const char *bindaddr) .stop = NULL, .cancel = htsp_server_cancel }; - htsp_server = tcp_server_create(LS_HTSP, "HTSP", bindaddr, tvheadend_htsp_port, &ops, NULL); + if(tvheadend_htsp_port) + htsp_server = tcp_server_create(LS_HTSP, "HTSP", bindaddr, tvheadend_htsp_port, &ops, NULL); if(tvheadend_htsp_port_extra) htsp_server_2 = tcp_server_create(LS_HTSP, "HTSP2", bindaddr, tvheadend_htsp_port_extra, &ops, NULL); } diff --git a/src/http.c b/src/http.c index 3c8d95a..738484f 100644 --- a/src/http.c +++ b/src/http.c @@ -1993,7 +1993,8 @@ http_server_init(const char *bindaddr) .cancel = http_cancel }; RB_INIT(&http_nonces); - http_server = tcp_server_create(LS_HTTP, "HTTP", bindaddr, tvheadend_webui_port, &ops, NULL); + if(tvheadend_webui_port) + http_server = tcp_server_create(LS_HTTP, "HTTP", bindaddr, tvheadend_webui_port, &ops, NULL); atomic_set(&http_server_running, 1); }