diff src/http/ngx_http_header_filter.c @ 64:34d647deb1da

nginx-0.0.1-2003-03-04-09:33:48 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 04 Mar 2003 06:33:48 +0000
parents 36d2c25cc9bb
children 5a7d1aaa1618
line wrap: on
line diff
--- a/src/http/ngx_http_header_filter.c
+++ b/src/http/ngx_http_header_filter.c
@@ -163,10 +163,10 @@ static int ngx_http_header_filter(ngx_ht
         len += 46;
     }
 
-    if (r->keepalive) {
+    if (r->keepalive == 0) {
+        len += 19;
+    } else {
         len += 24;
-    } else {
-        len += 19;
     }
 
     header = (ngx_table_elt_t *) r->headers_out.headers->elts;
@@ -238,13 +238,13 @@ static int ngx_http_header_filter(ngx_ht
         *(h->last.mem++) = CR; *(h->last.mem++) = LF;
     }
 
-    if (r->keepalive) {
+    if (r->keepalive == 0) {
+        ngx_memcpy(h->last.mem, "Connection: close" CRLF, 19);
+        h->last.mem += 19;
+
+    } else {
         ngx_memcpy(h->last.mem, "Connection: keep-alive" CRLF, 24);
         h->last.mem += 24;
-
-    } else {
-        ngx_memcpy(h->last.mem, "Connection: close" CRLF, 19);
-        h->last.mem += 19;
     }
 
     for (i = 0; i < r->headers_out.headers->nelts; i++) {