From: sb1066 Date: Wed, 7 Jul 2010 20:20:30 +0000 (+0000) Subject: Don't send the Content-Length if there is no content. This is needed in order for... X-Git-Tag: 2.12~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12e52fe4524fe22ba7f62bdaad522febc89bf64d;p=thirdparty%2Ftvheadend.git 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. --- diff --git a/src/http.c b/src/http.c index 580446c12..7c31d0630 100644 --- a/src/http.c +++ b/src/http.c @@ -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); }