#endif
void *http_server;
+static int http_server_running;
static http_path_list_t http_paths;
{
const char *errtxt = http_rc2str(error);
- if (!http_server) return;
+ if (!atomic_get(&http_server_running)) return;
if (error != HTTP_STATUS_FOUND && error != HTTP_STATUS_MOVED)
tvhlog(error < 400 ? LOG_INFO : LOG_ERR, "http", "%s: %s %s %s -- %d",
hc->hc_logout_cookie = 0;
- } while(hc->hc_keep_alive && http_server);
+ } while(hc->hc_keep_alive && atomic_get(&http_server_running));
error:
free(hdrline);
.cancel = http_cancel
};
http_server = tcp_server_create("http", "HTTP", bindaddr, tvheadend_webui_port, &ops, NULL);
+ atomic_set(&http_server_running, 1);
}
void
http_path_t *hp;
pthread_mutex_lock(&global_lock);
+ atomic_set(&http_server_running, 0);
if (http_server)
tcp_server_delete(http_server);
http_server = NULL;