Mercurial > hg > nginx
comparison src/stream/ngx_stream_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 |
---|---|
441 | 441 |
442 if (ngx_open_cached_file(lscf->open_file_cache, &log, &of, | 442 if (ngx_open_cached_file(lscf->open_file_cache, &log, &of, |
443 s->connection->pool) | 443 s->connection->pool) |
444 != NGX_OK) | 444 != NGX_OK) |
445 { | 445 { |
446 if (of.err == 0) { | |
447 /* simulate successful logging */ | |
448 return len; | |
449 } | |
450 | |
446 ngx_log_error(NGX_LOG_CRIT, s->connection->log, ngx_errno, | 451 ngx_log_error(NGX_LOG_CRIT, s->connection->log, ngx_errno, |
447 "%s \"%s\" failed", of.failed, log.data); | 452 "%s \"%s\" failed", of.failed, log.data); |
448 /* simulate successful logging */ | 453 /* simulate successful logging */ |
449 return len; | 454 return len; |
450 } | 455 } |