diff --git a/src/http.c b/src/http.c index 8fc9ff47..7236b7e8 100644 --- a/src/http.c +++ b/src/http.c @@ -1016,8 +1016,10 @@ http_cancel( void *opaque ) { http_connection_t *hc = opaque; - if (hc) + if (hc) { shutdown(hc->hc_fd, SHUT_RDWR); + hc->hc_shutdown = 1; + } } /** diff --git a/src/http.h b/src/http.h index 010ea6a9..388d59e2 100644 --- a/src/http.h +++ b/src/http.h @@ -137,14 +137,13 @@ typedef struct http_connection { int hc_no_output; int hc_logout_cookie; + int hc_shutdown; /* Support for HTTP POST */ char *hc_post_data; unsigned int hc_post_len; - struct rtsp *hc_rtsp_session; - } http_connection_t; diff --git a/src/webui/webui.c b/src/webui/webui.c index 7c23128a..eba5dbb6 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -253,7 +253,7 @@ http_stream_run(http_connection_t *hc, profile_chain_t *prch, tp.tv_usec = 0; setsockopt(hc->hc_fd, SOL_SOCKET, SO_SNDTIMEO, &tp, sizeof(tp)); - while(run && tvheadend_running) { + while(!hc->hc_shutdown && run && tvheadend_running) { pthread_mutex_lock(&sq->sq_mutex); sm = TAILQ_FIRST(&sq->sq_queue); if(sm == NULL) {