From 6a35754d7a609691688ae0ac6ed37093a7d81df1 Mon Sep 17 00:00:00 2001 From: lhanjian Date: Tue, 31 Oct 2023 17:13:04 +0800 Subject: [PATCH] open ngx_http_upstream_rbtree_lookup as api (#1868) --- src/http/ngx_http_upstream.c | 6 +----- src/http/ngx_http_upstream.h | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index e56de18ab9..542afb9f5e 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -209,10 +209,6 @@ static ngx_int_t ngx_http_upstream_ssl_certificate(ngx_http_request_t *r, #if (NGX_HTTP_UPSTREAM_RBTREE) static void ngx_http_upstream_rbtree_insert_value(ngx_rbtree_node_t *temp, ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel); - -static ngx_http_upstream_srv_conf_t * -ngx_http_upstream_rbtree_lookup(ngx_http_upstream_main_conf_t *umcf, - ngx_str_t *host); #endif static ngx_http_upstream_header_t ngx_http_upstream_headers_in[] = { @@ -6847,7 +6843,7 @@ ngx_http_upstream_rbtree_insert_value(ngx_rbtree_node_t *temp, } -static ngx_http_upstream_srv_conf_t * +ngx_http_upstream_srv_conf_t * ngx_http_upstream_rbtree_lookup(ngx_http_upstream_main_conf_t *umcf, ngx_str_t *host) { diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h index 94a6d659b5..bcbf6b4fa3 100644 --- a/src/http/ngx_http_upstream.h +++ b/src/http/ngx_http_upstream.h @@ -504,6 +504,12 @@ void ngx_http_upstream_check_delete_dynamic_peer(ngx_str_t *name, #endif +#if (NGX_HTTP_UPSTREAM_RBTREE) +ngx_http_upstream_srv_conf_t * +ngx_http_upstream_rbtree_lookup(ngx_http_upstream_main_conf_t *umcf, + ngx_str_t *host); +#endif + extern ngx_module_t ngx_http_upstream_module; extern ngx_conf_bitmask_t ngx_http_upstream_cache_method_mask[]; extern ngx_conf_bitmask_t ngx_http_upstream_ignore_headers_masks[];