From 12e52fe4524fe22ba7f62bdaad522febc89bf64d Mon Sep 17 00:00:00 2001 From: sb1066 Date: Wed, 7 Jul 2010 20:20:30 +0000 Subject: [PATCH] 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. --- src/http.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/http.c b/src/http.c index 580446c1..7c31d063 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); }