]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Don't send the Content-Length if there is no content. This is needed in order for...
authorsb1066 <sb1066@gmail.com>
Wed, 7 Jul 2010 20:20:30 +0000 (20:20 +0000)
committersb1066 <sb1066@gmail.com>
Wed, 7 Jul 2010 20:20:30 +0000 (20:20 +0000)
src/http.c

index 580446c12f56be222fcf2bd49c4060f35e9619bd..7c31d06303473ecfa4b2a208ca086dbeec5a7ffa 100644 (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);
 }