diff src/http/ngx_http_header_filter.c @ 153:c71aeb75c071

nginx-0.0.1-2003-10-21-20:49:56 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 21 Oct 2003 16:49:56 +0000
parents ef8c87afcfc5
children 46eb23d9471d
line wrap: on
line diff
--- a/src/http/ngx_http_header_filter.c
+++ b/src/http/ngx_http_header_filter.c
@@ -159,9 +159,11 @@ static int ngx_http_header_filter(ngx_ht
         len += 15 + r->headers_out.content_range->value.len + 2;
     }
 
-    if (r->headers_out.content_length >= 0) {
-        /* "Content-Length: ... \r\n", 2^64 is 20 characters */
-        len += 48;
+    if (r->headers_out.content_length == NULL) {
+        if (r->headers_out.content_length_n >= 0) {
+            /* "Content-Length: ... \r\n", 2^64 is 20 characters */
+            len += 48;
+        }
     }
 
     if (r->headers_out.content_type && r->headers_out.content_type->value.len) {
@@ -260,11 +262,13 @@ static int ngx_http_header_filter(ngx_ht
         *(h->last++) = CR; *(h->last++) = LF;
     }
 
-    /* 2^64 is 20 characters  */
-    if (r->headers_out.content_length >= 0) {
-        h->last += ngx_snprintf(h->last, 49,
-                                "Content-Length: " OFF_FMT CRLF,
-                                r->headers_out.content_length);
+    if (r->headers_out.content_length == NULL) {
+        /* 2^64 is 20 characters  */
+        if (r->headers_out.content_length_n >= 0) {
+            h->last += ngx_snprintf(h->last, 49,
+                                    "Content-Length: " OFF_FMT CRLF,
+                                    r->headers_out.content_length_n);
+        }
     }
 
     if (r->headers_out.content_type && r->headers_out.content_type->value.len) {