comparison src/core/ngx_file.c @ 633:f971949ffb58 release-0.3.38

nginx-0.3.38-RELEASE import *) Feature: the ngx_http_dav_module. *) Change: the ngx_http_perl_module optimizations. Thanks to Sergey Skvortsov. *) Feature: the ngx_http_perl_module supports the $r->request_body_file method. *) Feature: the "client_body_in_file_only" directive. *) Workaround: now on disk overflow nginx tries to write access logs once a second only. Thanks to Anton Yuzhaninov and Maxim Dounin. *) Bugfix: now the "limit_rate" directive more precisely limits rate if rate is more than 100 Kbyte/s. Thanks to ForJest. *) Bugfix: now the IMAP/POP3 proxy escapes the "\r" and "\n" symbols in login and password to pass authorization server. Thanks to Maxim Dounin.
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 Apr 2006 09:53:38 +0000
parents 65bf042c0b4f
children e60fe4cf1d4e
comparison
equal deleted inserted replaced
632:5c60f5f0887d 633:f971949ffb58
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); 22 tf->persistent, tf->mode);
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
34 } 34 }
35 35
36 36
37 ngx_int_t 37 ngx_int_t
38 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, 38 ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
39 ngx_uint_t persistent) 39 ngx_uint_t persistent, ngx_uint_t mode)
40 { 40 {
41 ngx_err_t err; 41 ngx_err_t err;
42 ngx_atomic_uint_t n; 42 ngx_atomic_uint_t n;
43 ngx_pool_cleanup_t *cln; 43 ngx_pool_cleanup_t *cln;
44 ngx_pool_cleanup_file_t *clnf; 44 ngx_pool_cleanup_file_t *clnf;
69 cln = ngx_pool_cleanup_add(pool, sizeof(ngx_pool_cleanup_file_t)); 69 cln = ngx_pool_cleanup_add(pool, sizeof(ngx_pool_cleanup_file_t));
70 if (cln == NULL) { 70 if (cln == NULL) {
71 return NGX_ERROR; 71 return NGX_ERROR;
72 } 72 }
73 73
74 #if 1 74 file->fd = ngx_open_tempfile(file->name.data, persistent, mode);
75 file->fd = ngx_open_tempfile(file->name.data, persistent);
76 #else
77 file->fd = ngx_open_tempfile(file->name.data, 1);
78 #endif
79 75
80 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0, 76 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0,
81 "temp fd:%d", file->fd); 77 "temp fd:%d", file->fd);
82 78
83 if (file->fd != NGX_INVALID_FILE) { 79 if (file->fd != NGX_INVALID_FILE) {