comparison src/http/ngx_http_file_cache.c @ 466:9eda3153223b NGINX_0_7_45

nginx 0.7.45 *) Change: now the "proxy_cache" and the "proxy_cache_valid" can be set on different levels. *) Change: the "clean_time" parameter of the "proxy_cache_path" directive is canceled. *) Feature: the "max_size" parameter of the "proxy_cache_path" directive. *) Feature: the ngx_http_fastcgi_module preliminary cache support. *) Feature: now on shared memory allocation errors directive and zone names are logged. *) Bugfix: the directive "add_header last-modified ''" did not delete a "Last-Modified" response header line; the bug had appeared in 0.7.44. *) Bugfix: a relative path in the "auth_basic_user_file" directive given without variables did not work; the bug had appeared in 0.7.44. Thanks to Jerome Loyet. *) Bugfix: in an "alias" directive given using variables without references to captures of regular expressions; the bug had appeared in 0.7.42.
author Igor Sysoev <http://sysoev.ru>
date Mon, 30 Mar 2009 00:00:00 +0400
parents c8cfb6c462ef
children 56baf312c1b5
comparison
equal deleted inserted replaced
465:29602be46850 466:9eda3153223b
249 249
250 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 250 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
251 "http file cache fd: %d", of.fd); 251 "http file cache fd: %d", of.fd);
252 252
253 c->file.fd = of.fd; 253 c->file.fd = of.fd;
254 c->file.log = r->connection->log;
254 255
255 c->buf = ngx_create_temp_buf(r->pool, c->body_start); 256 c->buf = ngx_create_temp_buf(r->pool, c->body_start);
256 if (c->buf == NULL) { 257 if (c->buf == NULL) {
257 return NGX_ERROR; 258 return NGX_ERROR;
258 } 259 }
353 } 354 }
354 355
355 if (fcn->uses >= r->cache->min_uses) { 356 if (fcn->uses >= r->cache->min_uses) {
356 357
357 r->cache->exists = fcn->exists; 358 r->cache->exists = fcn->exists;
358 359 r->cache->body_start = fcn->body_start;
359 if (fcn->body_start) {
360 r->cache->body_start = fcn->body_start;
361 }
362 360
363 rc = NGX_OK; 361 rc = NGX_OK;
364 362
365 } else { 363 } else {
366 rc = NGX_AGAIN; 364 rc = NGX_AGAIN;
814 ngx_queue_remove(q); 812 ngx_queue_remove(q);
815 813
816 ngx_rbtree_delete(cache->rbtree, &fcn->node); 814 ngx_rbtree_delete(cache->rbtree, &fcn->node);
817 815
818 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0, 816 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
819 "ignore long locked inactive cache entry %*s", 817 "ignore long locked inactive cache entry %*s, count:%d",
820 NGX_HTTP_CACHE_KEY_LEN, key); 818 2 * NGX_HTTP_CACHE_KEY_LEN, key, fcn->count);
821 } 819 }
822 820
823 if (tries++ < 10) { 821 if (tries++ < 10) {
824 continue; 822 continue;
825 } 823 }
893 time_t now, next; 891 time_t now, next;
894 ngx_tree_ctx_t tree; 892 ngx_tree_ctx_t tree;
895 893
896 now = ngx_time(); 894 now = ngx_time();
897 895
898 if (now >= cache->next_clean_time) { 896 if (now >= cache->next_clean_time
899 897 && now >= cache->created + cache->inactive)
898 {
900 ngx_log_error(NGX_LOG_NOTICE, ngx_cycle->log, 0, 899 ngx_log_error(NGX_LOG_NOTICE, ngx_cycle->log, 0,
901 "clean unused cache files"); 900 "clean unused cache files");
902 901
903 tree.init_handler = NULL; 902 tree.init_handler = NULL;
904 tree.file_handler = ngx_http_file_cache_clean_file; 903 tree.file_handler = ngx_http_file_cache_clean_file;