comparison src/http/ngx_http_script.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 39ff6939266e
children 9e25a5380a21
comparison
equal deleted inserted replaced
6947:a8d7c9139831 6948:3fb9b5eb75c0
1511 } 1511 }
1512 1512
1513 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) 1513 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
1514 != NGX_OK) 1514 != NGX_OK)
1515 { 1515 {
1516 if (of.err == 0) {
1517 e->ip = ngx_http_script_exit;
1518 e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
1519 return;
1520 }
1521
1516 if (of.err != NGX_ENOENT 1522 if (of.err != NGX_ENOENT
1517 && of.err != NGX_ENOTDIR 1523 && of.err != NGX_ENOTDIR
1518 && of.err != NGX_ENAMETOOLONG) 1524 && of.err != NGX_ENAMETOOLONG)
1519 { 1525 {
1520 ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err, 1526 ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,