comparison src/http/ngx_http_file_cache.c @ 536:0dc162a5f3e8 NGINX_0_8_20

nginx 0.8.20 *) Change: now default SSL ciphers are "HIGH:!ADH:!MD5". *) Bugfix: the ngx_http_autoindex_module did not show the trailing slash in links to a directory; the bug had appeared in 0.7.15. *) Bugfix: nginx did not close a log file set by the --error-log-path configuration option; the bug had appeared in 0.7.53. *) Bugfix: nginx did not treat a comma as separator in the "Cache-Control" backend response header line. *) Bugfix: nginx/Windows might not create temporary file, a cache file, or "proxy/fastcgi_store"d file if a worker has no enough access rights for top level directories. *) Bugfix: the "Set-Cookie" and "P3P" FastCGI response header lines were not hidden while caching if no "fastcgi_hide_header" directives were used with any parameters. *) Bugfix: nginx counted incorrectly disk cache size.
author Igor Sysoev <http://sysoev.ru>
date Wed, 14 Oct 2009 00:00:00 +0400
parents f7ec98e3caeb
children 2b9e388c61f1
comparison
equal deleted inserted replaced
535:4584144e5de2 536:0dc162a5f3e8
690 690
691 691
692 void 692 void
693 ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf) 693 ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf)
694 { 694 {
695 off_t size; 695 off_t size, length;
696 ngx_int_t rc; 696 ngx_int_t rc;
697 ngx_file_uniq_t uniq; 697 ngx_file_uniq_t uniq;
698 ngx_file_info_t fi; 698 ngx_file_info_t fi;
699 ngx_http_cache_t *c; 699 ngx_http_cache_t *c;
700 ngx_ext_rename_file_t ext; 700 ngx_ext_rename_file_t ext;
712 c->updated = 1; 712 c->updated = 1;
713 713
714 cache = c->file_cache; 714 cache = c->file_cache;
715 715
716 uniq = 0; 716 uniq = 0;
717 length = 0;
717 718
718 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 719 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
719 "http file cache rename: \"%s\" to \"%s\"", 720 "http file cache rename: \"%s\" to \"%s\"",
720 tf->file.name.data, c->file.name.data); 721 tf->file.name.data, c->file.name.data);
721 722
736 737
737 rc = NGX_ERROR; 738 rc = NGX_ERROR;
738 739
739 } else { 740 } else {
740 uniq = ngx_file_uniq(&fi); 741 uniq = ngx_file_uniq(&fi);
741 } 742 length = ngx_file_size(&fi);
742 } 743 }
743 744 }
744 size = (c->length + cache->bsize - 1) / cache->bsize; 745
746 size = (length + cache->bsize - 1) / cache->bsize;
745 747
746 ngx_shmtx_lock(&cache->shpool->mutex); 748 ngx_shmtx_lock(&cache->shpool->mutex);
747 749
748 c->node->count--; 750 c->node->count--;
749 c->node->uniq = uniq; 751 c->node->uniq = uniq;
750 c->node->body_start = c->body_start; 752 c->node->body_start = c->body_start;
751 753
752 size = size - (c->node->length + cache->bsize - 1) / cache->bsize; 754 size = size - (c->node->length + cache->bsize - 1) / cache->bsize;
753 755
754 c->node->length = c->length; 756 c->node->length = length;
755 757
756 cache->sh->size += size; 758 cache->sh->size += size;
757 759
758 if (rc == NGX_OK) { 760 if (rc == NGX_OK) {
759 c->node->exists = 1; 761 c->node->exists = 1;