diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/nginx.h | 2 | ||||
-rw-r--r-- | src/core/ngx_file.c | 37 | ||||
-rw-r--r-- | src/core/ngx_file.h | 2 |
3 files changed, 38 insertions, 3 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h index 1da91b729..2e13e6be4 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.3.39" +#define NGINX_VER "nginx/0.3.40" #define NGINX_VAR "NGINX" #define NGX_OLDPID_EXT ".oldbin" 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) { diff --git a/src/core/ngx_file.h b/src/core/ngx_file.h index 488c10ad6..3ec305612 100644 --- a/src/core/ngx_file.h +++ b/src/core/ngx_file.h @@ -51,6 +51,7 @@ typedef struct { ngx_uint_t mode; + unsigned log_level:8; unsigned persistent:1; } ngx_temp_file_t; @@ -60,6 +61,7 @@ ngx_int_t ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, ngx_uint_t persistent,ngx_uint_t mode); void ngx_create_hashed_filename(ngx_file_t *file, ngx_path_t *path); ngx_int_t ngx_create_path(ngx_file_t *file, ngx_path_t *path); +ngx_err_t ngx_create_full_path(u_char *dir); ngx_int_t ngx_add_path(ngx_conf_t *cf, ngx_path_t **slot); ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user); |