diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-04-19 15:30:56 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-04-19 15:30:56 +0000 |
commit | 7bdb720d6a7b75021ca7cea17d6f3199b5acf4ca (patch) | |
tree | 1ff27cb0b6a00fc3a58aee44f869baa6574f0329 /src/core/ngx_file.c | |
parent | afae3fd4a4ba16147fa7a4db8e4d90799ee3b56b (diff) | |
download | nginx-release-0.3.40.tar.gz nginx-release-0.3.40.zip |
nginx-0.3.40-RELEASE importrelease-0.3.40
*) Feature: the ngx_http_dav_module supports the MKCOL method.
*) Feature: the "create_full_put_path" directive.
*) Feature: the "$limit_rate" variable.
Diffstat (limited to 'src/core/ngx_file.c')
-rw-r--r-- | src/core/ngx_file.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c index 0a2c37190..c3c4592a7 100644 --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -25,8 +25,12 @@ ngx_write_chain_to_temp_file(ngx_temp_file_t *tf, ngx_chain_t *chain) return rc; } - if (!tf->persistent && tf->warn) { - ngx_log_error(NGX_LOG_WARN, tf->file.log, 0, tf->warn); + if (tf->log_level == NGX_LOG_NOTICE) { + ngx_log_error(NGX_LOG_NOTICE, tf->file.log, 0, tf->warn); + + } else if (tf->log_level == NGX_LOG_WARN) { + ngx_log_error(NGX_LOG_WARN, tf->file.log, 0, "%s %V", + tf->warn, &tf->file.name); } } @@ -182,6 +186,35 @@ ngx_create_path(ngx_file_t *file, ngx_path_t *path) } +ngx_err_t +ngx_create_full_path(u_char *dir) +{ + u_char *p, ch; + ngx_err_t err; + + for (p = dir + 1; *p; p++) { + ch = *p; + + if (ch != '/') { + continue; + } + + *p = '\0'; + + if (ngx_create_dir(dir) == NGX_FILE_ERROR) { + err = ngx_errno; + if (err != NGX_EEXIST) { + return err; + } + } + + *p = '/'; + } + + return 0; +} + + void ngx_init_temp_number(void) { |