Klaus Demo nginx / 3e6f74d
initialize of.uniq in ngx_open_cached_file() Igor Sysoev 12 years ago
7 changed file(s) with 19 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
188188 }
189189
190190 if ((file->event && file->use_event)
191 || (file->event == NULL && now - file->created < of->valid))
191 || (file->event == NULL
192 && (of->uniq == 0 || of->uniq == file->uniq)
193 && now - file->created < of->valid))
192194 {
193195 if (file->err == 0) {
194196
104104
105105 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
106106
107 of.uniq = 0;
107108 of.test_dir = 0;
108109 of.valid = clcf->open_file_cache_valid;
109110 of.min_uses = clcf->open_file_cache_min_uses;
118118
119119 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
120120
121 of.uniq = 0;
121122 of.test_dir = 0;
122123 of.valid = clcf->open_file_cache_valid;
123124 of.min_uses = clcf->open_file_cache_min_uses;
207207
208208 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "open index \"%V\"", &path);
209209
210 of.uniq = 0;
210211 of.test_dir = 0;
211212 of.valid = clcf->open_file_cache_valid;
212213 of.min_uses = clcf->open_file_cache_min_uses;
290291 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
291292 "http index check dir: \"%V\"", &dir);
292293
294 of.uniq = 0;
293295 of.test_dir = 1;
294296 of.valid = clcf->open_file_cache_valid;
295297 of.min_uses = 0;
9595
9696 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
9797
98 of.uniq = 0;
9899 of.test_dir = 0;
99100 of.valid = clcf->open_file_cache_valid;
100101 of.min_uses = clcf->open_file_cache_min_uses;
638638 XSRETURN_EMPTY;
639639 }
640640
641 path.len = ngx_strlen(filename);
642
643 path.data = ngx_pnalloc(r->pool, path.len + 1);
644 if (path.data == NULL) {
645 XSRETURN_EMPTY;
646 }
647
648 (void) ngx_cpystrn(path.data, filename, path.len + 1);
649
641650 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
642651
652 of.uniq = 0;
643653 of.test_dir = 0;
644654 of.valid = clcf->open_file_cache_valid;
645655 of.min_uses = clcf->open_file_cache_min_uses;
646656 of.errors = clcf->open_file_cache_errors;
647657 of.events = clcf->open_file_cache_events;
648
649 path.len = ngx_strlen(filename);
650
651 path.data = ngx_pnalloc(r->pool, path.len + 1);
652 if (path.data == NULL) {
653 XSRETURN_EMPTY;
654 }
655
656 (void) ngx_cpystrn(path.data, filename, path.len + 1);
657658
658659 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
659660 != NGX_OK)
993993
994994 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
995995
996 of.uniq = 0;
996997 of.test_dir = 0;
997998 of.valid = clcf->open_file_cache_valid;
998999 of.min_uses = clcf->open_file_cache_min_uses;