diff src/http/ngx_http_special_response.c @ 88:674d333f4296

nginx-0.0.1-2003-05-14-21:13:13 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 14 May 2003 17:13:13 +0000
parents 59229033ae93
children a23d010f356d
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -120,6 +120,7 @@ int ngx_http_special_response_handler(ng
     r->headers_out.status = error;
 
     if (error < NGX_HTTP_BAD_REQUEST) {
+        /* 3XX */
         err = error - NGX_HTTP_MOVED_PERMANENTLY;
 
     } else {
@@ -133,9 +134,11 @@ int ngx_http_special_response_handler(ng
         r->headers_out.content_type->value.data = "text/html";
 
         if (error < NGX_HTTP_INTERNAL_SERVER_ERROR) {
+            /* 4XX */
             err = error - NGX_HTTP_BAD_REQUEST + 3;
 
         } else {
+            /* 5XX */
             err = error - NGX_HTTP_INTERNAL_SERVER_ERROR + 3 + 17;
         }
     }
@@ -149,6 +152,15 @@ int ngx_http_special_response_handler(ng
         }
     }
 
+    if (r->lingering_close == 1) {
+        switch (error) {
+            case NGX_HTTP_BAD_REQUEST:
+            case NGX_HTTP_REQUEST_URI_TOO_LARGE:
+            case NGX_HTTP_INTERNAL_SERVER_ERROR:
+                r->lingering_close = 0;
+        }
+    }
+
     if (error_pages[err].len == 0) {
         r->headers_out.content_length = -1;
     } else {