initialize of.uniq in ngx_open_cached_file()
Igor Sysoev
13 years ago
188 | 188 |
}
|
189 | 189 |
|
190 | 190 |
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))
|
192 | 194 |
{
|
193 | 195 |
if (file->err == 0) {
|
194 | 196 |
|
104 | 104 |
|
105 | 105 |
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
106 | 106 |
|
|
107 |
of.uniq = 0;
|
107 | 108 |
of.test_dir = 0;
|
108 | 109 |
of.valid = clcf->open_file_cache_valid;
|
109 | 110 |
of.min_uses = clcf->open_file_cache_min_uses;
|
118 | 118 |
|
119 | 119 |
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
120 | 120 |
|
|
121 |
of.uniq = 0;
|
121 | 122 |
of.test_dir = 0;
|
122 | 123 |
of.valid = clcf->open_file_cache_valid;
|
123 | 124 |
of.min_uses = clcf->open_file_cache_min_uses;
|
207 | 207 |
|
208 | 208 |
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "open index \"%V\"", &path);
|
209 | 209 |
|
|
210 |
of.uniq = 0;
|
210 | 211 |
of.test_dir = 0;
|
211 | 212 |
of.valid = clcf->open_file_cache_valid;
|
212 | 213 |
of.min_uses = clcf->open_file_cache_min_uses;
|
|
290 | 291 |
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
291 | 292 |
"http index check dir: \"%V\"", &dir);
|
292 | 293 |
|
|
294 |
of.uniq = 0;
|
293 | 295 |
of.test_dir = 1;
|
294 | 296 |
of.valid = clcf->open_file_cache_valid;
|
295 | 297 |
of.min_uses = 0;
|
95 | 95 |
|
96 | 96 |
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
97 | 97 |
|
|
98 |
of.uniq = 0;
|
98 | 99 |
of.test_dir = 0;
|
99 | 100 |
of.valid = clcf->open_file_cache_valid;
|
100 | 101 |
of.min_uses = clcf->open_file_cache_min_uses;
|
638 | 638 |
XSRETURN_EMPTY;
|
639 | 639 |
}
|
640 | 640 |
|
|
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 |
|
641 | 650 |
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
642 | 651 |
|
|
652 |
of.uniq = 0;
|
643 | 653 |
of.test_dir = 0;
|
644 | 654 |
of.valid = clcf->open_file_cache_valid;
|
645 | 655 |
of.min_uses = clcf->open_file_cache_min_uses;
|
646 | 656 |
of.errors = clcf->open_file_cache_errors;
|
647 | 657 |
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);
|
657 | 658 |
|
658 | 659 |
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
|
659 | 660 |
!= NGX_OK)
|
993 | 993 |
|
994 | 994 |
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
995 | 995 |
|
|
996 |
of.uniq = 0;
|
996 | 997 |
of.test_dir = 0;
|
997 | 998 |
of.valid = clcf->open_file_cache_valid;
|
998 | 999 |
of.min_uses = clcf->open_file_cache_min_uses;
|