Mercurial > hg > nginx-vendor-0-6
diff src/core/ngx_file.c @ 186:54aabf2b0bc6 NGINX_0_3_40
nginx 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.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 19 Apr 2006 00:00:00 +0400 |
parents | 13710a1813ad |
children | 14050d2bec9b |
line wrap: on
line diff
--- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -25,8 +25,12 @@ ngx_write_chain_to_temp_file(ngx_temp_fi 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_pa } +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) {