Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 165:894a01c6aea3
nginx-0.0.1-2003-10-29-20:39:05 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 29 Oct 2003 17:39:05 +0000 |
parents | 84036764e215 |
children | 389d7ee9fa60 |
comparison
equal
deleted
inserted
replaced
164:84036764e215 | 165:894a01c6aea3 |
---|---|
38 | 38 |
39 "client %s sent invalid header, URL: %s", | 39 "client %s sent invalid header, URL: %s", |
40 "client %s sent too long header line, URL: %s", | 40 "client %s sent too long header line, URL: %s", |
41 "client %s sent HTTP/1.1 request without \"Host\" header, URL: %s", | 41 "client %s sent HTTP/1.1 request without \"Host\" header, URL: %s", |
42 "client %s sent invalid \"Content-Length\" header, URL: %s" | 42 "client %s sent invalid \"Content-Length\" header, URL: %s" |
43 }; | |
44 | |
45 | |
46 | |
47 ngx_http_header_t ngx_http_headers_in[] = { | |
48 { ngx_string("Host"), offsetof(ngx_http_headers_in_t, host) }, | |
49 { ngx_string("Connection"), offsetof(ngx_http_headers_in_t, connection) }, | |
50 { ngx_string("If-Modified-Since"), | |
51 offsetof(ngx_http_headers_in_t, if_modified_since) }, | |
52 { ngx_string("User-Agent"), offsetof(ngx_http_headers_in_t, user_agent) }, | |
53 | |
54 { ngx_string("Content-Length"), | |
55 offsetof(ngx_http_headers_in_t, content_length) }, | |
56 { ngx_string("Accept-Encoding"), | |
57 offsetof(ngx_http_headers_in_t, accept_encoding) }, | |
58 { ngx_string("Range"), offsetof(ngx_http_headers_in_t, range) }, | |
59 #if 0 | |
60 { ngx_string("If-Range"), offsetof(ngx_http_headers_in_t, if_range) }, | |
61 #endif | |
62 | |
63 { ngx_string("Keep-Alive"), offsetof(ngx_http_headers_in_t, keep_alive) }, | |
64 | |
65 { ngx_null_string, 0 } | |
66 }; | |
67 | |
68 | |
69 ngx_http_header_t ngx_http_headers_out[] = { | |
70 { ngx_string("Server"), offsetof(ngx_http_headers_out_t, server) }, | |
71 { ngx_string("Date"), offsetof(ngx_http_headers_out_t, date) }, | |
72 { ngx_string("Content-Type"), | |
73 offsetof(ngx_http_headers_out_t, content_type) }, | |
74 { ngx_string("Content-Length"), | |
75 offsetof(ngx_http_headers_out_t, content_length) }, | |
76 { ngx_string("Content-Encoding"), | |
77 offsetof(ngx_http_headers_out_t, content_encoding) }, | |
78 | |
79 /* Location */ | |
80 | |
81 { ngx_string("Last-Modified"), | |
82 offsetof(ngx_http_headers_out_t, last_modified) }, | |
83 { ngx_string("Accept-Ranges"), | |
84 offsetof(ngx_http_headers_out_t, accept_ranges) }, | |
85 | |
86 { ngx_null_string, 0 } | |
87 }; | 43 }; |
88 | 44 |
89 | 45 |
90 static void ngx_http_dummy(ngx_event_t *wev) | 46 static void ngx_http_dummy(ngx_event_t *wev) |
91 { | 47 { |
269 if (r->pool == NULL) { | 225 if (r->pool == NULL) { |
270 ngx_http_close_connection(c); | 226 ngx_http_close_connection(c); |
271 return; | 227 return; |
272 } | 228 } |
273 | 229 |
274 r->headers_out.headers = ngx_create_table(r->pool, 1); | 230 r->headers_out.headers = ngx_create_table(r->pool, 20); |
275 if (r->headers_out.headers == NULL) { | 231 if (r->headers_out.headers == NULL) { |
276 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | 232 ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
277 ngx_http_close_connection(c); | 233 ngx_http_close_connection(c); |
278 return; | 234 return; |
279 } | 235 } |
464 } | 420 } |
465 | 421 |
466 lctx = c->log->data; | 422 lctx = c->log->data; |
467 lctx->action = "reading client request headers"; | 423 lctx->action = "reading client request headers"; |
468 lctx->url = r->unparsed_uri.data; | 424 lctx->url = r->unparsed_uri.data; |
469 r->headers_in.headers = ngx_create_table(r->pool, 1); | 425 r->headers_in.headers = ngx_create_table(r->pool, 20); |
470 | 426 |
471 if (cscf->large_client_header | 427 if (cscf->large_client_header |
472 && r->header_in->pos == r->header_in->last) | 428 && r->header_in->pos == r->header_in->last) |
473 { | 429 { |
474 r->header_in->pos = r->header_in->last = r->header_in->start; | 430 r->header_in->pos = r->header_in->last = r->header_in->start; |