Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 6948:3fb9b5eb75c0
Fixed ngx_open_cached_file() error handling.
If of.err is 0, it means that there was a memory allocation error
and no further logging and/or processing is needed. The of.failed
string can be only accessed if of.err is not 0.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 28 Mar 2017 14:21:38 +0300 |
parents | 6e20a6479325 |
children | 99934aade555 |
comparison
equal
deleted
inserted
replaced
6947:a8d7c9139831 | 6948:3fb9b5eb75c0 |
---|---|
1312 } | 1312 } |
1313 | 1313 |
1314 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) | 1314 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) |
1315 != NGX_OK) | 1315 != NGX_OK) |
1316 { | 1316 { |
1317 if (of.err == 0) { | |
1318 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
1319 return NGX_OK; | |
1320 } | |
1321 | |
1317 if (of.err != NGX_ENOENT | 1322 if (of.err != NGX_ENOENT |
1318 && of.err != NGX_ENOTDIR | 1323 && of.err != NGX_ENOTDIR |
1319 && of.err != NGX_ENAMETOOLONG) | 1324 && of.err != NGX_ENAMETOOLONG) |
1320 { | 1325 { |
1321 ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, | 1326 ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, |