Mercurial > hg > nginx
comparison src/http/modules/ngx_http_proxy_module.c @ 7831:bdd4d89370a7
Changed complex value slots to use NGX_CONF_UNSET_PTR.
With this change, it is now possible to use ngx_conf_merge_ptr_value()
to merge complex values. This change follows much earlier changes in
ngx_conf_merge_ptr_value() and ngx_conf_set_str_array_slot()
in 1452:cd586e963db0 (0.6.10) and 1701:40d004d95d88 (0.6.22), and the
change in ngx_conf_set_keyval_slot() (7728:485dba3e2a01, 1.19.4).
To preserve compatibility with existing 3rd party modules, both NULL
and NGX_CONF_UNSET_PTR are accepted for now.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 06 May 2021 02:22:03 +0300 |
parents | 7ce28b4cc57e |
children | 3ab8e1e2f0f7 |
comparison
equal
deleted
inserted
replaced
7830:f2ff291bbdac | 7831:bdd4d89370a7 |
---|---|
3325 * conf->upstream.cache_methods = 0; | 3325 * conf->upstream.cache_methods = 0; |
3326 * conf->upstream.temp_path = NULL; | 3326 * conf->upstream.temp_path = NULL; |
3327 * conf->upstream.hide_headers_hash = { NULL, 0 }; | 3327 * conf->upstream.hide_headers_hash = { NULL, 0 }; |
3328 * conf->upstream.store_lengths = NULL; | 3328 * conf->upstream.store_lengths = NULL; |
3329 * conf->upstream.store_values = NULL; | 3329 * conf->upstream.store_values = NULL; |
3330 * conf->upstream.ssl_name = NULL; | |
3331 * | 3330 * |
3332 * conf->method = NULL; | |
3333 * conf->location = NULL; | 3331 * conf->location = NULL; |
3334 * conf->url = { 0, NULL }; | 3332 * conf->url = { 0, NULL }; |
3335 * conf->headers.lengths = NULL; | 3333 * conf->headers.lengths = NULL; |
3336 * conf->headers.values = NULL; | 3334 * conf->headers.values = NULL; |
3337 * conf->headers.hash = { NULL, 0 }; | 3335 * conf->headers.hash = { NULL, 0 }; |
3398 | 3396 |
3399 conf->upstream.intercept_errors = NGX_CONF_UNSET; | 3397 conf->upstream.intercept_errors = NGX_CONF_UNSET; |
3400 | 3398 |
3401 #if (NGX_HTTP_SSL) | 3399 #if (NGX_HTTP_SSL) |
3402 conf->upstream.ssl_session_reuse = NGX_CONF_UNSET; | 3400 conf->upstream.ssl_session_reuse = NGX_CONF_UNSET; |
3401 conf->upstream.ssl_name = NGX_CONF_UNSET_PTR; | |
3403 conf->upstream.ssl_server_name = NGX_CONF_UNSET; | 3402 conf->upstream.ssl_server_name = NGX_CONF_UNSET; |
3404 conf->upstream.ssl_verify = NGX_CONF_UNSET; | 3403 conf->upstream.ssl_verify = NGX_CONF_UNSET; |
3405 conf->ssl_verify_depth = NGX_CONF_UNSET_UINT; | 3404 conf->ssl_verify_depth = NGX_CONF_UNSET_UINT; |
3406 conf->ssl_passwords = NGX_CONF_UNSET_PTR; | 3405 conf->ssl_passwords = NGX_CONF_UNSET_PTR; |
3407 conf->ssl_conf_commands = NGX_CONF_UNSET_PTR; | 3406 conf->ssl_conf_commands = NGX_CONF_UNSET_PTR; |
3408 #endif | 3407 #endif |
3409 | 3408 |
3410 /* "proxy_cyclic_temp_file" is disabled */ | 3409 /* "proxy_cyclic_temp_file" is disabled */ |
3411 conf->upstream.cyclic_temp_file = 0; | 3410 conf->upstream.cyclic_temp_file = 0; |
3412 | 3411 |
3412 conf->upstream.change_buffering = 1; | |
3413 | |
3413 conf->headers_source = NGX_CONF_UNSET_PTR; | 3414 conf->headers_source = NGX_CONF_UNSET_PTR; |
3414 | 3415 |
3416 conf->method = NGX_CONF_UNSET_PTR; | |
3417 | |
3415 conf->redirect = NGX_CONF_UNSET; | 3418 conf->redirect = NGX_CONF_UNSET; |
3416 conf->upstream.change_buffering = 1; | |
3417 | 3419 |
3418 conf->cookie_domains = NGX_CONF_UNSET_PTR; | 3420 conf->cookie_domains = NGX_CONF_UNSET_PTR; |
3419 conf->cookie_paths = NGX_CONF_UNSET_PTR; | 3421 conf->cookie_paths = NGX_CONF_UNSET_PTR; |
3420 conf->cookie_flags = NGX_CONF_UNSET_PTR; | 3422 conf->cookie_flags = NGX_CONF_UNSET_PTR; |
3421 | 3423 |
3706 ngx_conf_merge_value(conf->upstream.cache_background_update, | 3708 ngx_conf_merge_value(conf->upstream.cache_background_update, |
3707 prev->upstream.cache_background_update, 0); | 3709 prev->upstream.cache_background_update, 0); |
3708 | 3710 |
3709 #endif | 3711 #endif |
3710 | 3712 |
3711 if (conf->method == NULL) { | |
3712 conf->method = prev->method; | |
3713 } | |
3714 | |
3715 ngx_conf_merge_value(conf->upstream.pass_request_headers, | 3713 ngx_conf_merge_value(conf->upstream.pass_request_headers, |
3716 prev->upstream.pass_request_headers, 1); | 3714 prev->upstream.pass_request_headers, 1); |
3717 ngx_conf_merge_value(conf->upstream.pass_request_body, | 3715 ngx_conf_merge_value(conf->upstream.pass_request_body, |
3718 prev->upstream.pass_request_body, 1); | 3716 prev->upstream.pass_request_body, 1); |
3719 | 3717 |
3730 |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2)); | 3728 |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2)); |
3731 | 3729 |
3732 ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, | 3730 ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers, |
3733 "DEFAULT"); | 3731 "DEFAULT"); |
3734 | 3732 |
3735 if (conf->upstream.ssl_name == NULL) { | 3733 ngx_conf_merge_ptr_value(conf->upstream.ssl_name, |
3736 conf->upstream.ssl_name = prev->upstream.ssl_name; | 3734 prev->upstream.ssl_name, NULL); |
3737 } | |
3738 | |
3739 ngx_conf_merge_value(conf->upstream.ssl_server_name, | 3735 ngx_conf_merge_value(conf->upstream.ssl_server_name, |
3740 prev->upstream.ssl_server_name, 0); | 3736 prev->upstream.ssl_server_name, 0); |
3741 ngx_conf_merge_value(conf->upstream.ssl_verify, | 3737 ngx_conf_merge_value(conf->upstream.ssl_verify, |
3742 prev->upstream.ssl_verify, 0); | 3738 prev->upstream.ssl_verify, 0); |
3743 ngx_conf_merge_uint_value(conf->ssl_verify_depth, | 3739 ngx_conf_merge_uint_value(conf->ssl_verify_depth, |
3758 if (conf->ssl && ngx_http_proxy_set_ssl(cf, conf) != NGX_OK) { | 3754 if (conf->ssl && ngx_http_proxy_set_ssl(cf, conf) != NGX_OK) { |
3759 return NGX_CONF_ERROR; | 3755 return NGX_CONF_ERROR; |
3760 } | 3756 } |
3761 | 3757 |
3762 #endif | 3758 #endif |
3759 | |
3760 ngx_conf_merge_ptr_value(conf->method, prev->method, NULL); | |
3763 | 3761 |
3764 ngx_conf_merge_value(conf->redirect, prev->redirect, 1); | 3762 ngx_conf_merge_value(conf->redirect, prev->redirect, 1); |
3765 | 3763 |
3766 if (conf->redirect) { | 3764 if (conf->redirect) { |
3767 | 3765 |