nginx-0.0.2-2004-03-12-19:57:08 import
diff --git a/src/http/modules/ngx_http_index_handler.c b/src/http/modules/ngx_http_index_handler.c
index 029843e..d5ecd41 100644
--- a/src/http/modules/ngx_http_index_handler.c
+++ b/src/http/modules/ngx_http_index_handler.c
@@ -46,6 +46,8 @@
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 @@
offsetof(ngx_http_index_loc_conf_t, index_cache),
NULL },
+#endif
+
ngx_null_command
};
@@ -125,6 +129,8 @@
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 @@
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 @@
/**/
+#if (NGX_HTTP_CACHE)
+
if (ilcf->index_cache) {
if (ctx->cache) {
@@ -271,6 +278,8 @@
}
}
+#endif
+
return ngx_http_internal_redirect(r, &ctx->redirect, NULL);
}