Mercurial > hg > nginx
diff src/http/modules/ngx_http_index_handler.c @ 287:35a6a9df2d25
nginx-0.0.2-2004-03-12-19:57:08 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 12 Mar 2004 16:57:08 +0000 |
parents | 70e1c7d2b83d |
children | f81d075ad172 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_index_handler.c +++ b/src/http/modules/ngx_http_index_handler.c @@ -46,6 +46,8 @@ static ngx_command_t ngx_http_index_com 0, NULL }, +#if (NGX_HTTP_CACHE) + { ngx_string("index_cache"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE3, ngx_http_set_cache_slot, @@ -53,6 +55,8 @@ static ngx_command_t ngx_http_index_com offsetof(ngx_http_index_loc_conf_t, index_cache), NULL }, +#endif + ngx_null_command }; @@ -125,6 +129,8 @@ int ngx_http_index_handler(ngx_http_requ sizeof(ngx_http_index_ctx_t), NGX_HTTP_INTERNAL_SERVER_ERROR); +#if (NGX_HTTP_CACHE) + if (ilcf->index_cache) { ctx->cache = ngx_http_cache_get(ilcf->index_cache, NULL, &r->uri, &crc); @@ -149,10 +155,9 @@ int ngx_http_index_handler(ngx_http_requ return ngx_http_internal_redirect(r, &ctx->redirect, NULL); } + } - } else { - ctx->cache = NULL; - } +#endif len = clcf->doc_root.len + r->uri.len + ilcf->max_index_len; if (!(ctx->path.data = ngx_palloc(r->pool, len))) { @@ -237,6 +242,8 @@ int ngx_http_index_handler(ngx_http_requ /**/ +#if (NGX_HTTP_CACHE) + if (ilcf->index_cache) { if (ctx->cache) { @@ -271,6 +278,8 @@ int ngx_http_index_handler(ngx_http_requ } } +#endif + return ngx_http_internal_redirect(r, &ctx->redirect, NULL); }