comparison 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
comparison
equal deleted inserted replaced
185:a9c5dc369ffe 186:54aabf2b0bc6
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
28 if (!tf->persistent && tf->warn) { 28 if (tf->log_level == NGX_LOG_NOTICE) {
29 ngx_log_error(NGX_LOG_WARN, tf->file.log, 0, tf->warn); 29 ngx_log_error(NGX_LOG_NOTICE, tf->file.log, 0, tf->warn);
30
31 } else if (tf->log_level == NGX_LOG_WARN) {
32 ngx_log_error(NGX_LOG_WARN, tf->file.log, 0, "%s %V",
33 tf->warn, &tf->file.name);
30 } 34 }
31 } 35 }
32 36
33 return ngx_write_chain_to_file(&tf->file, chain, tf->offset, tf->pool); 37 return ngx_write_chain_to_file(&tf->file, chain, tf->offset, tf->pool);
34 } 38 }
177 181
178 file->name.data[pos] = '/'; 182 file->name.data[pos] = '/';
179 } 183 }
180 184
181 return NGX_OK; 185 return NGX_OK;
186 }
187
188
189 ngx_err_t
190 ngx_create_full_path(u_char *dir)
191 {
192 u_char *p, ch;
193 ngx_err_t err;
194
195 for (p = dir + 1; *p; p++) {
196 ch = *p;
197
198 if (ch != '/') {
199 continue;
200 }
201
202 *p = '\0';
203
204 if (ngx_create_dir(dir) == NGX_FILE_ERROR) {
205 err = ngx_errno;
206 if (err != NGX_EEXIST) {
207 return err;
208 }
209 }
210
211 *p = '/';
212 }
213
214 return 0;
182 } 215 }
183 216
184 217
185 void 218 void
186 ngx_init_temp_number(void) 219 ngx_init_temp_number(void)