diff src/http/ngx_http_request.c @ 368:15c84a40e87d

nginx-0.0.7-2004-06-24-20:07:04 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 24 Jun 2004 16:07:04 +0000
parents ceec87d1c2b3
children 9c2515d70489
line wrap: on
line diff
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -159,10 +159,12 @@ static void ngx_http_init_request(ngx_ev
             ngx_http_close_connection(c);
             return;
         }
+
+        c->data = r;
     }
 
+    c->sent = 0;
     r->signature = NGX_HTTP_MODULE;
-    r->http_state = NGX_HTTP_INITING_REQUEST_STATE;
 
     /* find the server configuration for the address:port */
 
@@ -288,8 +290,6 @@ static void ngx_http_init_request(ngx_ev
         return;
     }
 
-    c->sent = 0;
-    c->data = r;
     r->connection = c;
     r->pipeline = c->pipeline;
     r->header_in = c->buffer;
@@ -301,6 +301,8 @@ static void ngx_http_init_request(ngx_ev
     r->headers_out.content_length_n = -1;
     r->headers_out.last_modified_time = -1;
 
+    r->http_state = NGX_HTTP_READING_REQUEST_STATE;
+
     rev->event_handler = ngx_http_process_request_line;
     ngx_http_process_request_line(rev);
 }
@@ -711,6 +713,8 @@ static void ngx_http_process_request_hea
             ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                            "http header done");
 
+            r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;
+
             rc = ngx_http_process_request_header(r);
 
             if (rc != NGX_OK) {
@@ -1055,6 +1059,8 @@ static void ngx_http_set_write_handler(n
         return;
     }
 
+    r->http_state = NGX_HTTP_WRITING_REQUEST_STATE;
+
     clcf = ngx_http_get_module_loc_conf(r->main ? r->main : r,
                                         ngx_http_core_module);
     if (!wev->delayed) {