Mercurial > hg > nginx-vendor-current
comparison src/http/ngx_http_core_module.c @ 372:6639b93e81b2 NGINX_0_6_30
nginx 0.6.30
*) Change: now if an "include" directive pattern does not match any
file, then nginx does not issue an error.
*) Feature: now the time in directives may be specified without spaces,
for example, "1h50m".
*) Bugfix: memory leaks if the "ssl_verify_client" directive was on.
Thanks to Chavelle Vincent.
*) Bugfix: the "sub_filter" directive might set text to change into
output.
*) Bugfix: the "error_page" directive did not take into account
arguments in redirected URI.
*) Bugfix: now nginx always opens files in binary mode under Cygwin.
*) Bugfix: nginx could not be built on OpenBSD; bug appeared in 0.6.15.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 29 Apr 2008 00:00:00 +0400 |
parents | babd3d9efb62 |
children | edf1cb6c328e |
comparison
equal
deleted
inserted
replaced
371:b6a2a305fdad | 372:6639b93e81b2 |
---|---|
43 | 43 |
44 static char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, | 44 static char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, |
45 void *dummy); | 45 void *dummy); |
46 static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, | 46 static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, |
47 void *dummy); | 47 void *dummy); |
48 static int ngx_http_core_cmp_locations(const void *first, const void *second); | 48 static ngx_int_t ngx_http_core_cmp_locations(const void *first, |
49 const void *second); | |
49 | 50 |
50 static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, | 51 static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, |
51 void *conf); | 52 void *conf); |
52 static char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, | 53 static char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, |
53 void *conf); | 54 void *conf); |
2295 | 2296 |
2296 return rv; | 2297 return rv; |
2297 } | 2298 } |
2298 | 2299 |
2299 | 2300 |
2300 static int | 2301 static ngx_int_t |
2301 ngx_http_core_cmp_locations(const void *one, const void *two) | 2302 ngx_http_core_cmp_locations(const void *one, const void *two) |
2302 { | 2303 { |
2303 ngx_int_t rc; | 2304 ngx_int_t rc; |
2304 ngx_http_core_loc_conf_t *first, *second; | 2305 ngx_http_core_loc_conf_t *first, *second; |
2305 | 2306 |
2359 if (rc == 0 && second->exact_match) { | 2360 if (rc == 0 && second->exact_match) { |
2360 /* an exact match must be before the same inclusive one */ | 2361 /* an exact match must be before the same inclusive one */ |
2361 return 1; | 2362 return 1; |
2362 } | 2363 } |
2363 | 2364 |
2364 return (int) rc; | 2365 return rc; |
2365 } | 2366 } |
2366 | 2367 |
2367 | 2368 |
2368 static char * | 2369 static char * |
2369 ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 2370 ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
3468 static char * | 3469 static char * |
3469 ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 3470 ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
3470 { | 3471 { |
3471 ngx_http_core_loc_conf_t *lcf = conf; | 3472 ngx_http_core_loc_conf_t *lcf = conf; |
3472 | 3473 |
3474 u_char *args; | |
3473 ngx_int_t overwrite; | 3475 ngx_int_t overwrite; |
3474 ngx_str_t *value, uri; | 3476 ngx_str_t *value, uri; |
3475 ngx_uint_t i, n, nvar; | 3477 ngx_uint_t i, n, nvar; |
3476 ngx_array_t *uri_lengths, *uri_values; | 3478 ngx_array_t *uri_lengths, *uri_values; |
3477 ngx_http_err_page_t *err; | 3479 ngx_http_err_page_t *err; |
3536 if (ngx_http_script_compile(&sc) != NGX_OK) { | 3538 if (ngx_http_script_compile(&sc) != NGX_OK) { |
3537 return NGX_CONF_ERROR; | 3539 return NGX_CONF_ERROR; |
3538 } | 3540 } |
3539 } | 3541 } |
3540 | 3542 |
3543 args = (u_char *) ngx_strchr(uri.data, '?'); | |
3544 | |
3541 for (i = 1; i < cf->args->nelts - n; i++) { | 3545 for (i = 1; i < cf->args->nelts - n; i++) { |
3542 err = ngx_array_push(lcf->error_pages); | 3546 err = ngx_array_push(lcf->error_pages); |
3543 if (err == NULL) { | 3547 if (err == NULL) { |
3544 return NGX_CONF_ERROR; | 3548 return NGX_CONF_ERROR; |
3545 } | 3549 } |
3574 err->overwrite = err->status; | 3578 err->overwrite = err->status; |
3575 break; | 3579 break; |
3576 } | 3580 } |
3577 } | 3581 } |
3578 | 3582 |
3579 err->uri = uri; | 3583 if (args) { |
3584 err->uri.len = args - uri.data; | |
3585 err->uri.data = uri.data; | |
3586 args++; | |
3587 err->args.len = (uri.data + uri.len) - args; | |
3588 err->args.data = args; | |
3589 | |
3590 } else { | |
3591 err->uri = uri; | |
3592 err->args.len = 0; | |
3593 err->args.data = NULL; | |
3594 } | |
3595 | |
3580 err->uri_lengths = uri_lengths; | 3596 err->uri_lengths = uri_lengths; |
3581 err->uri_values = uri_values; | 3597 err->uri_values = uri_values; |
3582 } | 3598 } |
3583 | 3599 |
3584 return NGX_CONF_OK; | 3600 return NGX_CONF_OK; |