Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 8786:d514f88053e5 quic
Merged with the default branch.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 28 May 2021 13:33:08 +0300 |
parents | 7f95010f10b7 1bde031b59ff |
children | 61d0fa67b55e |
comparison
equal
deleted
inserted
replaced
8785:e6c26cb4d38b | 8786:d514f88053e5 |
---|---|
1008 | 1008 |
1009 r->headers_out.location->hash = 1; | 1009 r->headers_out.location->hash = 1; |
1010 ngx_str_set(&r->headers_out.location->key, "Location"); | 1010 ngx_str_set(&r->headers_out.location->key, "Location"); |
1011 | 1011 |
1012 if (r->args.len == 0) { | 1012 if (r->args.len == 0) { |
1013 r->headers_out.location->value = clcf->name; | 1013 r->headers_out.location->value = clcf->escaped_name; |
1014 | 1014 |
1015 } else { | 1015 } else { |
1016 len = clcf->name.len + 1 + r->args.len; | 1016 len = clcf->escaped_name.len + 1 + r->args.len; |
1017 p = ngx_pnalloc(r->pool, len); | 1017 p = ngx_pnalloc(r->pool, len); |
1018 | 1018 |
1019 if (p == NULL) { | 1019 if (p == NULL) { |
1020 ngx_http_clear_location(r); | 1020 ngx_http_clear_location(r); |
1021 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | 1021 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
1023 } | 1023 } |
1024 | 1024 |
1025 r->headers_out.location->value.len = len; | 1025 r->headers_out.location->value.len = len; |
1026 r->headers_out.location->value.data = p; | 1026 r->headers_out.location->value.data = p; |
1027 | 1027 |
1028 p = ngx_cpymem(p, clcf->name.data, clcf->name.len); | 1028 p = ngx_cpymem(p, clcf->escaped_name.data, clcf->escaped_name.len); |
1029 *p++ = '?'; | 1029 *p++ = '?'; |
1030 ngx_memcpy(p, r->args.data, r->args.len); | 1030 ngx_memcpy(p, r->args.data, r->args.len); |
1031 } | 1031 } |
1032 | 1032 |
1033 ngx_http_finalize_request(r, NGX_HTTP_MOVED_PERMANENTLY); | 1033 ngx_http_finalize_request(r, NGX_HTTP_MOVED_PERMANENTLY); |
3465 } | 3465 } |
3466 | 3466 |
3467 /* | 3467 /* |
3468 * set by ngx_pcalloc(): | 3468 * set by ngx_pcalloc(): |
3469 * | 3469 * |
3470 * clcf->escaped_name = { 0, NULL }; | |
3470 * clcf->root = { 0, NULL }; | 3471 * clcf->root = { 0, NULL }; |
3471 * clcf->limit_except = 0; | 3472 * clcf->limit_except = 0; |
3472 * clcf->post_action = { 0, NULL }; | 3473 * clcf->post_action = { 0, NULL }; |
3473 * clcf->types = NULL; | 3474 * clcf->types = NULL; |
3474 * clcf->default_type = { 0, NULL }; | 3475 * clcf->default_type = { 0, NULL }; |
3477 * clcf->client_body_path = NULL; | 3478 * clcf->client_body_path = NULL; |
3478 * clcf->regex = NULL; | 3479 * clcf->regex = NULL; |
3479 * clcf->exact_match = 0; | 3480 * clcf->exact_match = 0; |
3480 * clcf->auto_redirect = 0; | 3481 * clcf->auto_redirect = 0; |
3481 * clcf->alias = 0; | 3482 * clcf->alias = 0; |
3482 * clcf->limit_rate = NULL; | |
3483 * clcf->limit_rate_after = NULL; | |
3484 * clcf->gzip_proxied = 0; | 3483 * clcf->gzip_proxied = 0; |
3485 * clcf->keepalive_disable = 0; | 3484 * clcf->keepalive_disable = 0; |
3486 */ | 3485 */ |
3487 | 3486 |
3488 clcf->client_max_body_size = NGX_CONF_UNSET; | 3487 clcf->client_max_body_size = NGX_CONF_UNSET; |
3510 clcf->tcp_nopush = NGX_CONF_UNSET; | 3509 clcf->tcp_nopush = NGX_CONF_UNSET; |
3511 clcf->tcp_nodelay = NGX_CONF_UNSET; | 3510 clcf->tcp_nodelay = NGX_CONF_UNSET; |
3512 clcf->send_timeout = NGX_CONF_UNSET_MSEC; | 3511 clcf->send_timeout = NGX_CONF_UNSET_MSEC; |
3513 clcf->send_lowat = NGX_CONF_UNSET_SIZE; | 3512 clcf->send_lowat = NGX_CONF_UNSET_SIZE; |
3514 clcf->postpone_output = NGX_CONF_UNSET_SIZE; | 3513 clcf->postpone_output = NGX_CONF_UNSET_SIZE; |
3514 clcf->limit_rate = NGX_CONF_UNSET_PTR; | |
3515 clcf->limit_rate_after = NGX_CONF_UNSET_PTR; | |
3515 clcf->keepalive_time = NGX_CONF_UNSET_MSEC; | 3516 clcf->keepalive_time = NGX_CONF_UNSET_MSEC; |
3516 clcf->keepalive_timeout = NGX_CONF_UNSET_MSEC; | 3517 clcf->keepalive_timeout = NGX_CONF_UNSET_MSEC; |
3517 clcf->keepalive_header = NGX_CONF_UNSET; | 3518 clcf->keepalive_header = NGX_CONF_UNSET; |
3518 clcf->keepalive_requests = NGX_CONF_UNSET_UINT; | 3519 clcf->keepalive_requests = NGX_CONF_UNSET_UINT; |
3519 clcf->lingering_close = NGX_CONF_UNSET_UINT; | 3520 clcf->lingering_close = NGX_CONF_UNSET_UINT; |
3741 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); | 3742 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); |
3742 ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0); | 3743 ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0); |
3743 ngx_conf_merge_size_value(conf->postpone_output, prev->postpone_output, | 3744 ngx_conf_merge_size_value(conf->postpone_output, prev->postpone_output, |
3744 1460); | 3745 1460); |
3745 | 3746 |
3746 if (conf->limit_rate == NULL) { | 3747 ngx_conf_merge_ptr_value(conf->limit_rate, prev->limit_rate, NULL); |
3747 conf->limit_rate = prev->limit_rate; | 3748 ngx_conf_merge_ptr_value(conf->limit_rate_after, |
3748 } | 3749 prev->limit_rate_after, NULL); |
3749 | |
3750 if (conf->limit_rate_after == NULL) { | |
3751 conf->limit_rate_after = prev->limit_rate_after; | |
3752 } | |
3753 | 3750 |
3754 ngx_conf_merge_msec_value(conf->keepalive_time, | 3751 ngx_conf_merge_msec_value(conf->keepalive_time, |
3755 prev->keepalive_time, 3600000); | 3752 prev->keepalive_time, 3600000); |
3756 ngx_conf_merge_msec_value(conf->keepalive_timeout, | 3753 ngx_conf_merge_msec_value(conf->keepalive_timeout, |
3757 prev->keepalive_timeout, 75000); | 3754 prev->keepalive_timeout, 75000); |