comparison src/core/ngx_file.c @ 1075:4d203f76b757

undo "client_body_in_file_only any" and introduce "client_body_in_file_only clean" introduce ngx_pool_delete_file() to not break a possible third-party ngx_pool_cleanup_file() usage that may lead to an removal of the useful files delete unnecessary ngx_http_finalize_request_body()
author Igor Sysoev <igor@sysoev.ru>
date Thu, 25 Jan 2007 08:45:04 +0000
parents 01f818c6f7de
children 01b48bcb73bf
comparison
equal deleted inserted replaced
1074:8164f479b362 1075:4d203f76b757
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;