diff src/http/ngx_http_core_module.c @ 152:fb48bf4fea1c

nginx-0.0.1-2003-10-21-11:47:21 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 21 Oct 2003 07:47:21 +0000
parents 5afee0074707
children c71aeb75c071
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -207,13 +207,31 @@ void ngx_http_handler(ngx_http_request_t
     lcx = r->connection->log->data;
     lcx->action = NULL;
 
+    /* STUB */
     r->keepalive = 1;
+    if (r->headers_in.connection) {
+        if (r->headers_in.connection->value.len == 5
+            && ngx_strcasecmp(r->headers_in.connection->value.data, "close")
+                                                                          == 0)
+        {
+            r->keepalive = 0;
+        }
+    }
+
+#if 0
+    /* TEST STUB */ r->keepalive = 0;
+#endif
 
     if (r->headers_in.content_length_n > 0) {
         r->lingering_close = 1;
+
+    } else {
+        r->lingering_close = 0;
     }
 
+#if 0
     /* TEST STUB */ r->lingering_close = 1;
+#endif
 
     r->connection->write->event_handler = ngx_http_phase_event_handler;
 
@@ -258,6 +276,11 @@ static void ngx_http_run_phases(ngx_http
         {
             rc = h[r->phase_handler](r);
 
+            if (rc == NGX_DONE) {
+                return;
+            }
+
+            /* TODO THINK: is it dupliate NGX_DONE ??? */
             if (r->closed) {
                 return;
             }
@@ -435,7 +458,7 @@ int ngx_http_internal_redirect(ngx_http_
 
     ngx_http_handler(r);
 
-    return NGX_OK;
+    return NGX_DONE;
 }