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:
sb1066 2010-07-07 20:20:30 +00:00
parent 6c0f240e5e
commit 12e52fe452

View file

@ -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);
}