diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2004-03-12 16:57:08 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2004-03-12 16:57:08 +0000 |
| commit | 67f88e9cc678d31b5995518922d3fcb63a129465 (patch) | |
| tree | 370c489b498feddaf17f12b125f6f75d69cdb9f2 /src/http/modules/ngx_http_static_handler.c | |
| parent | a893eab667078a8ad9f473296663b36e6ade111a (diff) | |
| download | nginx-67f88e9cc678d31b5995518922d3fcb63a129465.tar.gz nginx-67f88e9cc678d31b5995518922d3fcb63a129465.tar.bz2 | |
nginx-0.0.2-2004-03-12-19:57:08 import
Diffstat (limited to 'src/http/modules/ngx_http_static_handler.c')
| -rw-r--r-- | src/http/modules/ngx_http_static_handler.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c index 699747123..6925a031b 100644 --- a/src/http/modules/ngx_http_static_handler.c +++ b/src/http/modules/ngx_http_static_handler.c @@ -18,6 +18,8 @@ static ngx_int_t ngx_http_static_init(ngx_cycle_t *cycle); static ngx_command_t ngx_http_static_commands[] = { +#if (NGX_HTTP_CACHE) + { ngx_string("redirect_cache"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE3, ngx_http_set_cache_slot, @@ -25,6 +27,8 @@ static ngx_command_t ngx_http_static_commands[] = { offsetof(ngx_http_static_loc_conf_t, redirect_cache), NULL }, +#endif + ngx_null_command }; @@ -87,6 +91,8 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) return rc; } +#if (NGX_HTTP_CACHE) + /* * there is a valid cached open file, i.e by the index handler, * and it should be already registered in r->cleanup @@ -96,6 +102,8 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) return ngx_http_send_cached(r); } +#endif + log = r->connection->log; clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); @@ -138,6 +146,7 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) redirect_cleanup = NULL; } +#if (NGX_HTTP_CACHE) /* look up an open files cache */ @@ -192,6 +201,7 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) redirect = NULL; } +#endif /* open file */ @@ -302,6 +312,8 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) r->headers_out.location->value = location; +#if (NGX_HTTP_CACHE) + if (slcf->redirect_cache) { if (redirect) { if (location.len == redirect->data.value.len @@ -345,6 +357,8 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) } +#endif + return NGX_HTTP_MOVED_PERMANENTLY; } @@ -365,6 +379,8 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) #endif +#if (NGX_HTTP_CACHE) + if (clcf->open_files) { #if (NGX_USE_HTTP_FILE_CACHE_UNIQ) @@ -416,6 +432,7 @@ static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r) return ngx_http_send_cached(r); } +#endif ctx = log->data; ctx->action = "sending response to client"; |
