comparison src/core/ngx_file.c @ 464:c8cfb6c462ef NGINX_0_7_44

nginx 0.7.44 *) Feature: the ngx_http_proxy_module preliminary cache support. *) Feature: the --with-pcre option in the configure. *) Feature: the "try_files" directive is now allowed on the server block level. *) Bugfix: the "try_files" directive handled incorrectly a query string in a fallback parameter. *) Bugfix: the "try_files" directive might test incorrectly directories. *) Bugfix: if there is the single server for given address:port pair, then captures in regular expressions in a "server_name" directive did not work.
author Igor Sysoev <http://sysoev.ru>
date Mon, 23 Mar 2009 00:00:00 +0300
parents a8424ffa495c
children 56baf312c1b5
comparison
equal deleted inserted replaced
463:51cb914e6d3a 464:c8cfb6c462ef
262 if (ngx_conf_full_name(cf->cycle, &path->name, 0) != NGX_OK) { 262 if (ngx_conf_full_name(cf->cycle, &path->name, 0) != NGX_OK) {
263 return NULL; 263 return NULL;
264 } 264 }
265 265
266 path->len = 0; 266 path->len = 0;
267 path->cleaner = (ngx_gc_handler_pt) cmd->post; 267 path->cleaner = (ngx_path_cleaner_pt) cmd->post;
268 path->conf_file = cf->conf_file->file.name.data; 268 path->conf_file = cf->conf_file->file.name.data;
269 path->line = cf->conf_file->line; 269 path->line = cf->conf_file->line;
270 270
271 for (i = 0, n = 2; n < cf->args->nelts; i++, n++) { 271 for (i = 0, n = 2; n < cf->args->nelts; i++, n++) {
272 level = ngx_atoi(value[n].data, value[n].len); 272 level = ngx_atoi(value[n].data, value[n].len);
283 } 283 }
284 284
285 *slot = path; 285 *slot = path;
286 286
287 if (ngx_add_path(cf, slot) == NGX_ERROR) { 287 if (ngx_add_path(cf, slot) == NGX_ERROR) {
288 return NGX_CONF_ERROR;
289 }
290
291 return NGX_CONF_OK;
292 }
293
294
295 char *
296 ngx_conf_merge_path_value(ngx_conf_t *cf, ngx_path_t **path, ngx_path_t *prev,
297 ngx_path_init_t *init)
298 {
299 if (*path) {
300 return NGX_CONF_OK;
301 }
302
303 if (prev) {
304 *path = prev;
305 return NGX_CONF_OK;
306 }
307
308 *path = ngx_palloc(cf->pool, sizeof(ngx_path_t));
309 if (*path == NULL) {
310 return NGX_CONF_ERROR;
311 }
312
313 (*path)->name = init->name;
314
315 if (ngx_conf_full_name(cf->cycle, &(*path)->name, 0) != NGX_OK) {
316 return NGX_CONF_ERROR;
317 }
318
319 (*path)->level[0] = init->level[0];
320 (*path)->level[1] = init->level[1];
321 (*path)->level[2] = init->level[2];
322
323 (*path)->len = init->level[0] + (init->level[0] ? 1 : 0)
324 + init->level[1] + (init->level[1] ? 1 : 0)
325 + init->level[2] + (init->level[2] ? 1 : 0);
326
327 (*path)->cleaner = NULL;
328 (*path)->conf_file = NULL;
329
330 if (ngx_add_path(cf, path) != NGX_OK) {
288 return NGX_CONF_ERROR; 331 return NGX_CONF_ERROR;
289 } 332 }
290 333
291 return NGX_CONF_OK; 334 return NGX_CONF_OK;
292 } 335 }