Project

General

Profile

Feature #4734 ยป Support-disable-HTTP-and-HTSP-services.diff

Mono Polimorph, 2017-11-28 12:42

View differences:

src/avahi.c
135 135
     tvhdebug(LS_AVAHI, "Adding service '%s'", name);
136 136

  
137 137
    /* Add the service for HTSP */
138
    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC,
139
                                            AVAHI_PROTO_UNSPEC, 0, name,
138
    if (tvheadend_htsp_port)
139
     if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC,
140
                                            AVAHI_PROTO_UNSPEC, 0, name,
140 141
                                            "_htsp._tcp", NULL, NULL,tvheadend_htsp_port,
141 142
                                            NULL)) < 0) {
142 143

  
......
157 158
    }
158 159

  
159 160
    /* Add the service for HTTP */
160
    if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC,
161
                                            AVAHI_PROTO_UNSPEC, 0, name,
161
    if (tvheadend_webui_port)
162
     if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC,
163
                                            AVAHI_PROTO_UNSPEC, 0, name,
162 164
                                            "_http._tcp", NULL, NULL, tvheadend_webui_port,
163 165
                                            path,
164 166
                                            NULL)) < 0) {
src/bonjour.c
107 107
    { "path", tvheadend_webroot ? tvheadend_webroot : "/" },
108 108
    { .key = NULL }
109 109
  };
110

  
111
  bonjour_start_service(&svc_http, "_http._tcp", tvheadend_webui_port,
110

  
111
  if(tvheadend_webui_port)
112
    bonjour_start_service(&svc_http, "_http._tcp", tvheadend_webui_port,
112 113
                        txt_rec_http);
113 114

  
114
  bonjour_start_service(&svc_htsp, "_htsp._tcp", tvheadend_htsp_port, NULL);
115
  if(tvheadend_htsp_port)
116
    bonjour_start_service(&svc_htsp, "_htsp._tcp", tvheadend_htsp_port, NULL);
115 117
}
116 118

  
117 119
void
src/htsp_server.c
3495 3495
    .stop   = NULL,
3496 3496
    .cancel = htsp_server_cancel
3497 3497
  };
3498
  htsp_server = tcp_server_create(LS_HTSP, "HTSP", bindaddr, tvheadend_htsp_port, &ops, NULL);
3498
  if(tvheadend_htsp_port)
3499
    htsp_server = tcp_server_create(LS_HTSP, "HTSP", bindaddr, tvheadend_htsp_port, &ops, NULL);
3499 3500
  if(tvheadend_htsp_port_extra)
3500 3501
    htsp_server_2 = tcp_server_create(LS_HTSP, "HTSP2", bindaddr, tvheadend_htsp_port_extra, &ops, NULL);
3501 3502
}
src/http.c
1993 1993
    .cancel = http_cancel
1994 1994
  };
1995 1995
  RB_INIT(&http_nonces);
1996
  http_server = tcp_server_create(LS_HTTP, "HTTP", bindaddr, tvheadend_webui_port, &ops, NULL);
1996
  if(tvheadend_webui_port)
1997
    http_server = tcp_server_create(LS_HTTP, "HTTP", bindaddr, tvheadend_webui_port, &ops, NULL);
1997 1998
  atomic_set(&http_server_running, 1);
1998 1999
}
1999 2000

  
    (1-1/1)