comparison 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
comparison
equal deleted inserted replaced
367:ceec87d1c2b3 368:15c84a40e87d
157 } else { 157 } else {
158 if (!(r = ngx_pcalloc(c->pool, sizeof(ngx_http_request_t)))) { 158 if (!(r = ngx_pcalloc(c->pool, sizeof(ngx_http_request_t)))) {
159 ngx_http_close_connection(c); 159 ngx_http_close_connection(c);
160 return; 160 return;
161 } 161 }
162 } 162
163 163 c->data = r;
164 }
165
166 c->sent = 0;
164 r->signature = NGX_HTTP_MODULE; 167 r->signature = NGX_HTTP_MODULE;
165 r->http_state = NGX_HTTP_INITING_REQUEST_STATE;
166 168
167 /* find the server configuration for the address:port */ 169 /* find the server configuration for the address:port */
168 170
169 /* AF_INET only */ 171 /* AF_INET only */
170 172
286 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); 288 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
287 ngx_http_close_connection(c); 289 ngx_http_close_connection(c);
288 return; 290 return;
289 } 291 }
290 292
291 c->sent = 0;
292 c->data = r;
293 r->connection = c; 293 r->connection = c;
294 r->pipeline = c->pipeline; 294 r->pipeline = c->pipeline;
295 r->header_in = c->buffer; 295 r->header_in = c->buffer;
296 296
297 r->file.fd = NGX_INVALID_FILE; 297 r->file.fd = NGX_INVALID_FILE;
298 298
299 r->headers_in.content_length_n = -1; 299 r->headers_in.content_length_n = -1;
300 r->headers_in.keep_alive_n = -1; 300 r->headers_in.keep_alive_n = -1;
301 r->headers_out.content_length_n = -1; 301 r->headers_out.content_length_n = -1;
302 r->headers_out.last_modified_time = -1; 302 r->headers_out.last_modified_time = -1;
303
304 r->http_state = NGX_HTTP_READING_REQUEST_STATE;
303 305
304 rev->event_handler = ngx_http_process_request_line; 306 rev->event_handler = ngx_http_process_request_line;
305 ngx_http_process_request_line(rev); 307 ngx_http_process_request_line(rev);
306 } 308 }
307 309
708 710
709 /* a whole header has been parsed successfully */ 711 /* a whole header has been parsed successfully */
710 712
711 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 713 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
712 "http header done"); 714 "http header done");
715
716 r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;
713 717
714 rc = ngx_http_process_request_header(r); 718 rc = ngx_http_process_request_header(r);
715 719
716 if (rc != NGX_OK) { 720 if (rc != NGX_OK) {
717 ngx_http_client_error(r, rc, NGX_HTTP_BAD_REQUEST); 721 ngx_http_client_error(r, rc, NGX_HTTP_BAD_REQUEST);
1053 1057
1054 if (wev->ready && wev->delayed) { 1058 if (wev->ready && wev->delayed) {
1055 return; 1059 return;
1056 } 1060 }
1057 1061
1062 r->http_state = NGX_HTTP_WRITING_REQUEST_STATE;
1063
1058 clcf = ngx_http_get_module_loc_conf(r->main ? r->main : r, 1064 clcf = ngx_http_get_module_loc_conf(r->main ? r->main : r,
1059 ngx_http_core_module); 1065 ngx_http_core_module);
1060 if (!wev->delayed) { 1066 if (!wev->delayed) {
1061 ngx_add_timer(wev, clcf->send_timeout); 1067 ngx_add_timer(wev, clcf->send_timeout);
1062 } 1068 }