diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2017-03-28 14:21:38 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2017-03-28 14:21:38 +0300 |
commit | 9ad18e43ac2c9956399018cbb998337943988333 (patch) | |
tree | 5fa775ea2ea833bb65b18714d3eafd3539a784b5 /src/stream/ngx_stream_log_module.c | |
parent | eb017e75cf1b1d82179935b0e23d0c3451b33a87 (diff) | |
download | nginx-9ad18e43ac2c9956399018cbb998337943988333.tar.gz nginx-9ad18e43ac2c9956399018cbb998337943988333.zip |
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.
Diffstat (limited to 'src/stream/ngx_stream_log_module.c')
-rw-r--r-- | src/stream/ngx_stream_log_module.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stream/ngx_stream_log_module.c b/src/stream/ngx_stream_log_module.c index 6b293403f..466bdda51 100644 --- 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_session_t *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 */ |