From 3e6f74da0556265b7ad3fbdb629f2898b1e1936f Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 23 Jun 2008 13:35:34 +0000 Subject: initialize of.uniq in ngx_open_cached_file() --- src/http/modules/perl/nginx.xs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/http/modules/perl/nginx.xs') diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs index de4d20074..cc0fc4ba6 100644 --- a/src/http/modules/perl/nginx.xs +++ b/src/http/modules/perl/nginx.xs @@ -639,14 +639,6 @@ sendfile(r, filename, offset = -1, bytes = 0) XSRETURN_EMPTY; } - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - - of.test_dir = 0; - of.valid = clcf->open_file_cache_valid; - of.min_uses = clcf->open_file_cache_min_uses; - of.errors = clcf->open_file_cache_errors; - of.events = clcf->open_file_cache_events; - path.len = ngx_strlen(filename); path.data = ngx_pnalloc(r->pool, path.len + 1); @@ -656,6 +648,15 @@ sendfile(r, filename, offset = -1, bytes = 0) (void) ngx_cpystrn(path.data, filename, path.len + 1); + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + + of.uniq = 0; + of.test_dir = 0; + of.valid = clcf->open_file_cache_valid; + of.min_uses = clcf->open_file_cache_min_uses; + of.errors = clcf->open_file_cache_errors; + of.events = clcf->open_file_cache_events; + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) != NGX_OK) { -- cgit