Mercurial > hg > nginx
diff 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 |
line wrap: on
line diff
--- a/src/stream/ngx_stream_log_module.c +++ b/src/stream/ngx_stream_log_module.c @@ -443,6 +443,11 @@ ngx_stream_log_script_write(ngx_stream_s s->connection->pool) != NGX_OK) { + if (of.err == 0) { + /* simulate successful logging */ + return len; + } + ngx_log_error(NGX_LOG_CRIT, s->connection->log, ngx_errno, "%s \"%s\" failed", of.failed, log.data); /* simulate successful logging */