Mercurial > hg > nginx
comparison src/http/modules/ngx_http_log_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 | c36d160cd4e0 |
children | 265c29b0b8b8 |
comparison
equal
deleted
inserted
replaced
6947:a8d7c9139831 | 6948:3fb9b5eb75c0 |
---|---|
550 } | 550 } |
551 | 551 |
552 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) | 552 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) |
553 != NGX_OK) | 553 != NGX_OK) |
554 { | 554 { |
555 if (of.err == 0) { | |
556 /* simulate successful logging */ | |
557 return len; | |
558 } | |
559 | |
555 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, | 560 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, |
556 "%s \"%s\" failed", of.failed, log.data); | 561 "%s \"%s\" failed", of.failed, log.data); |
557 /* simulate successful logging */ | 562 /* simulate successful logging */ |
558 return len; | 563 return len; |
559 } | 564 } |