Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
http server: improve shutdown for streaming
  • Loading branch information
perexg committed Oct 26, 2014
1 parent 46ce1de commit dec23ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/http.c
Expand Up @@ -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;
}
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/http.h
Expand Up @@ -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;


Expand Down
2 changes: 1 addition & 1 deletion src/webui/webui.c
Expand Up @@ -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) {
Expand Down

0 comments on commit dec23ca

Please sign in to comment.