summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2012-12-23 15:27:55 +0000
committerValentin Bartenev <vbart@nginx.com>2012-12-23 15:27:55 +0000
commitdf71cd1125390512bbd421b0218b4bbc0e1d5209 (patch)
treeb0ed0059b4edd7e8072769fd963c8ca4150dc0f6 /src
parent7c4068d349106f68524ac4fa3da9454d6b5cb8f4 (diff)
downloadnginx-df71cd1125390512bbd421b0218b4bbc0e1d5209.tar.gz
nginx-df71cd1125390512bbd421b0218b4bbc0e1d5209.tar.bz2
Access log: fixed redundant buffer reallocation.
Previously a new buffer was allocated for every "access_log" directive with the same file path and "buffer=" parameters, while only one buffer per file is used.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_log_module.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c
index 0962c8475..69dd59bf9 100644
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -970,11 +970,15 @@ buffer:
return NGX_CONF_ERROR;
}
- if (log->file->buffer && log->file->last - log->file->pos != buf) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "access_log \"%V\" already defined "
- "with different buffer size", &value[1]);
- return NGX_CONF_ERROR;
+ if (log->file->buffer) {
+ if (log->file->last - log->file->pos != buf) {
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "access_log \"%V\" already defined "
+ "with different buffer size", &value[1]);
+ return NGX_CONF_ERROR;
+ }
+
+ return NGX_CONF_OK;
}
log->file->buffer = ngx_palloc(cf->pool, buf);