diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-11-15 16:30:52 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-11-15 16:30:52 +0300 |
commit | 0e5dc5cff692f532f0ccb2655ab196995f4233e0 (patch) | |
tree | f56f40e788077b9820ebb45f3e0739fabb7be421 /src/http/ngx_http_core_module.c | |
parent | 2a7f83eceda87e520f36bbfb16b82b8c2d6606d7 (diff) |
nginx-0.3.10-RELEASE importrelease-0.3.10
*) Change: the "valid_referers" directive and the "$invalid_referer"
variable were moved to the new ngx_http_referer_module from the
ngx_http_rewrite_module.
*) Change: the "$apache_bytes_sent" variable name was changed to
"$body_bytes_sent".
*) Feature: the "$sent_http_..." variables.
*) Feature: the "if" directive supports the "=" and "!=" operations.
*) Feature: the "proxy_pass" directive supports the HTTPS protocol.
*) Feature: the "proxy_set_body" directive.
*) Feature: the "post_action" directive.
*) Feature: the ngx_http_empty_gif_module.
*) Feature: the "worker_cpu_affinity" directive for Linux.
*) Bugfix: the "rewrite" directive did not unescape URI part in
redirect, now it is unescaped except the %00-%25 and %7F-%FF
characters.
*) Bugfix: nginx could not be built by the icc 9.0 compiler.
*) Bugfix: if the SSI was enabled for zero size static file, then the
chunked response was encoded incorrectly.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index c230860bb..5fd53179d 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -343,6 +343,14 @@ static ngx_command_t ngx_http_core_commands[] = { 0, NULL }, + { ngx_string("post_action"), + NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF + |NGX_CONF_TAKE1, + ngx_conf_set_str_slot, + NGX_HTTP_LOC_CONF_OFFSET, + offsetof(ngx_http_core_loc_conf_t, post_action), + NULL }, + { ngx_string("error_log"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, ngx_http_core_error_log, @@ -514,7 +522,7 @@ ngx_http_core_run_phases(ngx_http_request_t *r) if (rc == NGX_DONE) { /* - * we should never use r here because + * we should never use r here because * it may point to already freed data */ @@ -1034,9 +1042,9 @@ ngx_http_auth_basic_user(ngx_http_request_t *r) r->headers_in.user.data = (u_char *) ""; return NGX_DECLINED; } - + auth.len = ngx_base64_decoded_length(encoded.len); - auth.data = ngx_palloc(r->pool, auth.len + 1); + auth.data = ngx_palloc(r->pool, auth.len + 1); if (auth.data == NULL) { return NGX_ERROR; } @@ -1045,15 +1053,15 @@ ngx_http_auth_basic_user(ngx_http_request_t *r) r->headers_in.user.data = (u_char *) ""; return NGX_DECLINED; } - + auth.data[auth.len] = '\0'; - - for (len = 0; len < auth.len; len++) { + + for (len = 0; len < auth.len; len++) { if (auth.data[len] == ':') { break; } } - + if (len == 0 || len == auth.len) { r->headers_in.user.data = (u_char *) ""; return NGX_DECLINED; @@ -1105,8 +1113,10 @@ ngx_http_subrequest(ngx_http_request_t *r, sr->headers_in = r->headers_in; sr->start_time = ngx_time(); - sr->headers_out.content_length_n = -1; - sr->headers_out.last_modified_time = -1; + + ngx_http_clear_content_length(sr); + ngx_http_clear_accept_ranges(sr); + ngx_http_clear_last_modified(sr); sr->request_body = r->request_body; @@ -1859,11 +1869,10 @@ ngx_http_core_create_loc_conf(ngx_conf_t *cf) /* * set by ngx_pcalloc(): * - * lcf->root.len = 0; - * lcf->root.data = NULL; + * lcf->root = { 0, NULL }; + * lcf->post_action = { 0, NULL }; * lcf->types = NULL; - * lcf->default_type.len = 0; - * lcf->default_type.data = NULL; + * lcf->default_type = { 0, NULL }; * lcf->err_log = NULL; * lcf->error_pages = NULL; * lcf->client_body_path = NULL; @@ -1923,13 +1932,17 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, return NGX_CONF_ERROR; } + if (conf->post_action.data == NULL) { + conf->post_action = prev->post_action; + } + if (conf->types == NULL) { if (prev->types) { conf->types = prev->types; } else { conf->types = ngx_palloc(cf->pool, NGX_HTTP_TYPES_HASH_PRIME - * sizeof(ngx_array_t)); + * sizeof(ngx_array_t)); if (conf->types == NULL) { return NGX_CONF_ERROR; } @@ -2038,7 +2051,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) */ value = cf->args->elts; - + ngx_memzero(&inet_upstream, sizeof(ngx_inet_upstream_t)); inet_upstream.url = value[1]; @@ -2050,7 +2063,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s in \"%V\" of the \"listen\" directive", err, &inet_upstream.url); - return NGX_CONF_ERROR; + return NGX_CONF_ERROR; } ls = ngx_array_push(&scf->listen); @@ -2084,7 +2097,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) inet_upstream.host.data); return NGX_CONF_ERROR; } - + ls->addr = *(in_addr_t *)(h->h_addr_list[0]); } |