comparison src/core/ngx_file.c @ 278:704622b2528a NGINX_0_5_9

nginx 0.5.9 *) Change: now the ngx_http_memcached_module uses the $memcached_key variable value as a key. *) Feature: the $memcached_key variable. *) Feature: the "clean" parameter in the "client_body_in_file_only" directive. *) Feature: the "env" directive. *) Feature: the "sendfile" directive is available inside the "if" block. *) Feature: now on failure of the writing to access nginx logs a message to error_log, but not more often than once a minute. *) Bugfix: the "access_log off" directive did not always turn off the logging.
author Igor Sysoev <http://sysoev.ru>
date Thu, 25 Jan 2007 00:00:00 +0300
parents c5c2b2883984
children 675a39fd14cd
comparison
equal deleted inserted replaced
277:b3aec7787b8e 278:704622b2528a
17 { 17 {
18 ngx_int_t rc; 18 ngx_int_t rc;
19 19
20 if (tf->file.fd == NGX_INVALID_FILE) { 20 if (tf->file.fd == NGX_INVALID_FILE) {
21 rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool, 21 rc = ngx_create_temp_file(&tf->file, tf->path, tf->pool,
22 tf->persistent, tf->access); 22 tf->persistent, tf->clean, tf->access);
23 23
24 if (rc == NGX_ERROR || rc == NGX_AGAIN) { 24 if (rc == NGX_ERROR || rc == NGX_AGAIN) {
25 return rc; 25 return rc;
26 } 26 }
27 27
35 } 35 }
36 36
37 37
38 ngx_int_t 38 ngx_int_t
39 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, 39 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
40 ngx_uint_t persistent, ngx_uint_t access) 40 ngx_uint_t persistent, ngx_uint_t clean, ngx_uint_t access)
41 { 41 {
42 ngx_err_t err; 42 ngx_err_t err;
43 ngx_atomic_uint_t n; 43 ngx_atomic_uint_t n;
44 ngx_pool_cleanup_t *cln; 44 ngx_pool_cleanup_t *cln;
45 ngx_pool_cleanup_file_t *clnf; 45 ngx_pool_cleanup_file_t *clnf;
77 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0, 77 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0,
78 "temp fd:%d", file->fd); 78 "temp fd:%d", file->fd);
79 79
80 if (file->fd != NGX_INVALID_FILE) { 80 if (file->fd != NGX_INVALID_FILE) {
81 81
82 cln->handler = ngx_pool_cleanup_file; 82 cln->handler = clean ? ngx_pool_delete_file : ngx_pool_cleanup_file;
83 clnf = cln->data; 83 clnf = cln->data;
84 84
85 clnf->fd = file->fd; 85 clnf->fd = file->fd;
86 clnf->name = file->name.data; 86 clnf->name = file->name.data;
87 clnf->log = pool->log; 87 clnf->log = pool->log;