Don't send the Content-Length if there is no content. This is needed in order for a http stream to work with vlc, totem, wget etc.
This commit is contained in:
parent
6c0f240e5e
commit
12e52fe452
1 changed files with 4 additions and 4 deletions
|
@ -204,10 +204,10 @@ http_send_header(http_connection_t *hc, int rc, const char *content,
|
|||
if(content != NULL)
|
||||
htsbuf_qprintf(&hdrs, "Content-Type: %s\r\n", content);
|
||||
|
||||
htsbuf_qprintf(&hdrs,
|
||||
"Content-Length: %d\r\n"
|
||||
"\r\n",
|
||||
contentlen);
|
||||
if(contentlen > 0)
|
||||
htsbuf_qprintf(&hdrs, "Content-Length: %d\r\n", contentlen);
|
||||
|
||||
htsbuf_qprintf(&hdrs, "\r\n");
|
||||
|
||||
tcp_write_queue(hc->hc_fd, &hdrs);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue