optimization
diff --git a/src/http/modules/ngx_http_flv_module.c b/src/http/modules/ngx_http_flv_module.c index 1e8f96f..0e19091 100644 --- a/src/http/modules/ngx_http_flv_module.c +++ b/src/http/modules/ngx_http_flv_module.c
@@ -111,10 +111,9 @@ of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; - rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool); - - if (rc == NGX_ERROR) { - + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) + != NGX_OK) + { switch (of.err) { case 0:
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c index e4aaeb3..6018203 100644 --- a/src/http/modules/ngx_http_gzip_static_module.c +++ b/src/http/modules/ngx_http_gzip_static_module.c
@@ -125,10 +125,9 @@ of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; - rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool); - - if (rc == NGX_ERROR) { - + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) + != NGX_OK) + { switch (of.err) { case 0: @@ -143,20 +142,18 @@ case NGX_EACCES: level = NGX_LOG_ERR; - rc = NGX_DECLINED; break; default: level = NGX_LOG_CRIT; - rc = NGX_DECLINED; break; } ngx_log_error(level, log, of.err, ngx_open_file_n " \"%s\" failed", path.data); - return rc; + return NGX_DECLINED; } ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd);
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c index c962283..6bfb045 100644 --- a/src/http/modules/ngx_http_index_module.c +++ b/src/http/modules/ngx_http_index_module.c
@@ -214,10 +214,9 @@ of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; - rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool); - - if (rc == NGX_ERROR) { - + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) + != NGX_OK) + { ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, of.err, ngx_open_file_n " \"%s\" failed", path.data);
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c index cfc7089..c4e688f 100644 --- a/src/http/modules/ngx_http_static_module.c +++ b/src/http/modules/ngx_http_static_module.c
@@ -102,10 +102,9 @@ of.errors = clcf->open_file_cache_errors; of.events = clcf->open_file_cache_events; - rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool); - - if (rc == NGX_ERROR) { - + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) + != NGX_OK) + { switch (of.err) { case 0:
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs index 78455b9..c665446 100644 --- a/src/http/modules/perl/nginx.xs +++ b/src/http/modules/perl/nginx.xs
@@ -613,7 +613,6 @@ char *filename; int offset; size_t bytes; - ngx_int_t rc; ngx_str_t path; ngx_buf_t *b; ngx_open_file_info_t of; @@ -657,10 +656,9 @@ (void) ngx_cpystrn(path.data, filename, path.len + 1); - rc = ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool); - - if (rc == NGX_ERROR) { - + if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) + != NGX_OK) + { if (of.err == 0) { XSRETURN_EMPTY; }
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c index e30fda2..0af34e3 100644 --- a/src/http/ngx_http_script.c +++ b/src/http/ngx_http_script.c
@@ -982,7 +982,7 @@ of.events = clcf->open_file_cache_events; if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) - == NGX_ERROR) + != NGX_OK) { if (of.err != NGX_ENOENT && of.err != NGX_ENOTDIR) { ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,