diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-09-06 18:45:00 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-09-06 18:45:00 +0000 |
commit | aab4d8c0c4aa068cc7ddcb1c5daee330d9dec47a (patch) | |
tree | 30f6fb63eb08c72af5855f0a784df32a64057706 /src/http/ngx_http_request.c | |
parent | 980a92472cc30271ad7e88eb2dcc43f00e984d4d (diff) | |
download | nginx-aab4d8c0c4aa068cc7ddcb1c5daee330d9dec47a.tar.gz nginx-aab4d8c0c4aa068cc7ddcb1c5daee330d9dec47a.zip |
nginx-0.0.10-2004-09-06-22:45:00 import
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 185db72a7..52c7c4256 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -49,6 +49,41 @@ static char *client_header_errors[] = { }; +ngx_http_header_t ngx_http_headers_in[] = { + { ngx_string("Host"), offsetof(ngx_http_headers_in_t, host) }, + { ngx_string("Connection"), offsetof(ngx_http_headers_in_t, connection) }, + { ngx_string("If-Modified-Since"), + offsetof(ngx_http_headers_in_t, if_modified_since) }, + { ngx_string("User-Agent"), offsetof(ngx_http_headers_in_t, user_agent) }, + { ngx_string("Referer"), offsetof(ngx_http_headers_in_t, referer) }, + { ngx_string("Content-Length"), + offsetof(ngx_http_headers_in_t, content_length) }, + + { ngx_string("Range"), offsetof(ngx_http_headers_in_t, range) }, +#if 0 + { ngx_string("If-Range"), offsetof(ngx_http_headers_in_t, if_range) }, +#endif + +#if (NGX_HTTP_GZIP) + { ngx_string("Accept-Encoding"), + offsetof(ngx_http_headers_in_t, accept_encoding) }, + { ngx_string("Via"), offsetof(ngx_http_headers_in_t, via) }, +#endif + + { ngx_string("Authorization"), + offsetof(ngx_http_headers_in_t, authorization) }, + + { ngx_string("Keep-Alive"), offsetof(ngx_http_headers_in_t, keep_alive) }, + +#if (NGX_HTTP_PROXY) + { ngx_string("X-Forwarded-For"), + offsetof(ngx_http_headers_in_t, x_forwarded_for) }, +#endif + + { ngx_null_string, 0 } +}; + + #if 0 static void ngx_http_dummy(ngx_event_t *wev) { @@ -310,7 +345,7 @@ static void ngx_http_init_request(ngx_event_t *rev) r->cleanup.pool = r->pool; - if (ngx_init_list(&r->headers_out.headers, r->pool, 2, + if (ngx_list_init(&r->headers_out.headers, r->pool, 20, sizeof(ngx_table_elt_t)) == NGX_ERROR) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); @@ -319,23 +354,6 @@ static void ngx_http_init_request(ngx_event_t *rev) } -#if 0 - /* init the r->headers_out.headers table */ - - r->headers_out.headers.elts = ngx_pcalloc(r->pool, - 20 * sizeof(ngx_table_elt_t)); - if (r->headers_out.headers.elts == NULL) { - ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); - ngx_http_close_connection(c); - return; - } - /* r->headers_out.headers.nelts = 0; */ - r->headers_out.headers.nalloc = 20; - r->headers_out.headers.size = sizeof(ngx_table_elt_t); - r->headers_out.headers.pool = r->pool; -#endif - - r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module); if (r->ctx == NULL) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); @@ -619,7 +637,7 @@ static void ngx_http_process_request_line(ngx_event_t *rev) } - if (ngx_init_list(&r->headers_in.headers, r->pool, 2, + if (ngx_list_init(&r->headers_in.headers, r->pool, 20, sizeof(ngx_table_elt_t)) == NGX_ERROR) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); @@ -628,7 +646,7 @@ static void ngx_http_process_request_line(ngx_event_t *rev) } - if (ngx_init_array0(&r->headers_in.cookies, r->pool, 5, + if (ngx_array_init(&r->headers_in.cookies, r->pool, 5, sizeof(ngx_table_elt_t *)) == NGX_ERROR) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); @@ -772,7 +790,7 @@ static void ngx_http_process_request_headers(ngx_event_t *rev) r->headers_n++; - if (!(h = ngx_push_list(&r->headers_in.headers))) { + if (!(h = ngx_list_push(&r->headers_in.headers))) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); ngx_http_close_connection(c); return; |