diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-10-27 15:46:13 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-10-27 15:46:13 +0000 |
commit | 697d1aea0c7b1525beed2911f9f32426280df8f4 (patch) | |
tree | 3c59875442d9a8114785a04003fcc3b7b059dc55 /src/core/ngx_conf_file.c | |
parent | 968b2a868ba7950b7c11c81905eeb5ed87b889f2 (diff) | |
download | nginx-release-0.3.7.tar.gz nginx-release-0.3.7.zip |
nginx-0.3.7-RELEASE importrelease-0.3.7
*) Feature: the "access_log" supports the "buffer=" parameter.
*) Bugfix: nginx could not be built on platforms different from i386,
amd64, sparc, and ppc; the bug had appeared in 0.3.2.
Diffstat (limited to 'src/core/ngx_conf_file.c')
-rw-r--r-- | src/core/ngx_conf_file.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index 78e61f8c1..acec1308f 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -11,6 +11,7 @@ static ngx_int_t ngx_conf_handler(ngx_conf_t *cf, ngx_int_t last); static ngx_int_t ngx_conf_read_token(ngx_conf_t *cf); static char *ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); +static void ngx_conf_flush_files(ngx_cycle_t *cycle); static ngx_command_t ngx_conf_commands[] = { @@ -36,7 +37,7 @@ ngx_module_t ngx_conf_module = { NULL, /* init process */ NULL, /* init thread */ NULL, /* exit thread */ - NULL, /* exit process */ + ngx_conf_flush_files, /* exit process */ NULL, /* exit master */ NGX_MODULE_V1_PADDING }; @@ -742,10 +743,44 @@ ngx_conf_open_file(ngx_cycle_t *cycle, ngx_str_t *name) file->name.data = NULL; } + file->buffer = NULL; + return file; } +static void +ngx_conf_flush_files(ngx_cycle_t *cycle) +{ + ngx_uint_t i; + ngx_list_part_t *part; + ngx_open_file_t *file; + + ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "flush files"); + + part = &cycle->open_files.part; + file = part->elts; + + for (i = 0; /* void */ ; i++) { + + if (i >= part->nelts) { + if (part->next == NULL) { + break; + } + part = part->next; + file = part->elts; + i = 0; + } + + if (file[i].buffer == NULL || file[i].pos - file[i].buffer == 0) { + continue; + } + + ngx_write_fd(file[i].fd, file[i].buffer, file[i].pos - file[i].buffer); + } +} + + void ngx_cdecl ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err, char *fmt, ...) |