Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
webui: streaming - implement properly HEAD request for streaming URLs…
…, fixes #2999
  • Loading branch information
perexg committed Jul 6, 2015
1 parent a7082af commit 5905158
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/webui/webui.c
Expand Up @@ -262,6 +262,7 @@ http_stream_run(http_connection_t *hc, profile_chain_t *prch,
struct timeval tp;
int err = 0;
socklen_t errlen = sizeof(err);
int64_t mono;

if(muxer_open_stream(mux, hc->hc_fd))
run = 0;
Expand Down Expand Up @@ -324,9 +325,21 @@ http_stream_run(http_connection_t *hc, profile_chain_t *prch,
case SMT_START:
grace = 10;
if(!started) {
tvhlog(LOG_DEBUG, "webui", "Start streaming %s", hc->hc_url_orig);
tvhlog(LOG_DEBUG, "webui", "%s streaming %s",
hc->hc_no_output ? "Probe" : "Start", hc->hc_url_orig);
http_output_content(hc, muxer_mime(mux, sm->sm_data));

if (hc->hc_no_output) {
streaming_msg_free(sm);
mono = getmonoclock() + 2000000;
while (getmonoclock() < mono) {
if (getsockopt(hc->hc_fd, SOL_SOCKET, SO_ERROR, (char *)&err, &errlen) || err)
break;
usleep(50000);
}
return;
}

if(muxer_init(mux, sm->sm_data, name) < 0)
run = 0;

Expand Down

1 comment on commit 5905158

@Jalle19
Copy link
Contributor

@Jalle19 Jalle19 commented on 5905158 Jul 8, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and the followup commit) should probably be backported to the release branch.

Please sign in to comment.