summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_index_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-03-12 16:57:08 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-03-12 16:57:08 +0000
commit67f88e9cc678d31b5995518922d3fcb63a129465 (patch)
tree370c489b498feddaf17f12b125f6f75d69cdb9f2 /src/http/modules/ngx_http_index_handler.c
parenta893eab667078a8ad9f473296663b36e6ade111a (diff)
downloadnginx-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_index_handler.c')
-rw-r--r--src/http/modules/ngx_http_index_handler.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_index_handler.c b/src/http/modules/ngx_http_index_handler.c
index 029843e70..d5ecd41f1 100644
--- 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_commands[] = {
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_commands[] = {
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_request_t *r)
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,11 +155,10 @@ int ngx_http_index_handler(ngx_http_request_t *r)
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))) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
@@ -237,6 +242,8 @@ int ngx_http_index_handler(ngx_http_request_t *r)
/**/
+#if (NGX_HTTP_CACHE)
+
if (ilcf->index_cache) {
if (ctx->cache) {
@@ -271,6 +278,8 @@ int ngx_http_index_handler(ngx_http_request_t *r)
}
}
+#endif
+
return ngx_http_internal_redirect(r, &ctx->redirect, NULL);
}