aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-08-29 10:07:58 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-08-29 10:07:58 +0000
commitee25a6384c742f9ad8bb0e8c41fa0223c10d09d2 (patch)
tree5cdc37ef3ea4c9795162bb4cfb182acc4203098a /src
parent34f579fb6d3c6582a685e65265f332fa8cf83fe8 (diff)
downloadnginx-ee25a6384c742f9ad8bb0e8c41fa0223c10d09d2.tar.gz
nginx-ee25a6384c742f9ad8bb0e8c41fa0223c10d09d2.zip
Merge of r3972, r3973, r3974:
Cache fixes: *) do not close connection if cache file is too small: replace it with valid one *) rename ngx_http_file_cache_manager_sleep() to ngx_http_file_cache_loader_sleep() and do not use it all in cache manager: this is a vestige of the times when cache manager loaded cache *) set correct configuration file values while adding path
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_file_cache.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
index bba4f99d8..baf1144c2 100644
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -31,7 +31,7 @@ static time_t ngx_http_file_cache_expire(ngx_http_file_cache_t *cache);
static void ngx_http_file_cache_delete(ngx_http_file_cache_t *cache,
ngx_queue_t *q, u_char *name);
static ngx_int_t
- ngx_http_file_cache_manager_sleep(ngx_http_file_cache_t *cache);
+ ngx_http_file_cache_loader_sleep(ngx_http_file_cache_t *cache);
static ngx_int_t ngx_http_file_cache_noop(ngx_tree_ctx_t *ctx,
ngx_str_t *path);
static ngx_int_t ngx_http_file_cache_manage_file(ngx_tree_ctx_t *ctx,
@@ -376,7 +376,7 @@ ngx_http_file_cache_read(ngx_http_request_t *r, ngx_http_cache_t *c)
if ((size_t) n < c->header_start) {
ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
"cache file \"%s\" is too small", c->file.name.data);
- return NGX_ERROR;
+ return NGX_DECLINED;
}
h = (ngx_http_file_cache_header_t *) c->buf->pos;
@@ -1208,7 +1208,7 @@ ngx_http_file_cache_manager(void *data)
return wait;
}
- if (ngx_http_file_cache_manager_sleep(cache) != NGX_OK) {
+ if (ngx_quit || ngx_terminate) {
return next;
}
}
@@ -1262,7 +1262,7 @@ ngx_http_file_cache_loader(void *data)
static ngx_int_t
-ngx_http_file_cache_manager_sleep(ngx_http_file_cache_t *cache)
+ngx_http_file_cache_loader_sleep(ngx_http_file_cache_t *cache)
{
ngx_msec_t elapsed;
@@ -1314,7 +1314,7 @@ ngx_http_file_cache_manage_file(ngx_tree_ctx_t *ctx, ngx_str_t *path)
(void) ngx_http_file_cache_delete_file(ctx, path);
}
- return ngx_http_file_cache_manager_sleep(cache);
+ return ngx_http_file_cache_loader_sleep(cache);
}
@@ -1605,6 +1605,8 @@ ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
cache->path->manager = ngx_http_file_cache_manager;
cache->path->loader = ngx_http_file_cache_loader;
cache->path->data = cache;
+ cache->path->conf_file = cf->conf_file->file.name.data;
+ cache->path->line = cf->conf_file->line;
if (ngx_add_path(cf, &cache->path) != NGX_OK) {
return NGX_CONF_ERROR;