mirror of
https://github.com/nginx/nginx.git
synced 2026-06-26 11:52:00 +00:00
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.
This commit is contained in:
parent
7c4068d349
commit
df71cd1125
1 changed files with 9 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue