diff options
author | Jean-Frederic Clere <jfclere@apache.org> | 2021-03-09 09:39:21 +0100 |
---|---|---|
committer | Jean-Frederic Clere <jfclere@apache.org> | 2021-03-09 09:39:21 +0100 |
commit | 6cbbf4f0b102dccc4c235763e81f4ba94e30affd (patch) | |
tree | 5285bdc5f38e8e44785499d0260c80b72eede2be /modules | |
parent | refrain from handling ip address alt names in pre 1.1 openssl (diff) | |
download | apache2-6cbbf4f0b102dccc4c235763e81f4ba94e30affd.tar.xz apache2-6cbbf4f0b102dccc4c235763e81f4ba94e30affd.zip |
Use an optional function as adviced by RĂ¼diger.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/proxy/mod_proxy.h | 10 | ||||
-rw-r--r-- | modules/proxy/mod_proxy_balancer.c | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h index b29b9a7c0e..1ad95309de 100644 --- a/modules/proxy/mod_proxy.h +++ b/modules/proxy/mod_proxy.h @@ -1336,6 +1336,16 @@ PROXY_DECLARE(int) ap_proxy_tunnel_run(proxy_tunnel_rec *tunnel); APR_DECLARE_OPTIONAL_FN(int, ap_proxy_clear_connection, (request_rec *r, apr_table_t *headers)); +/** + * Configure and create workers (and balancer) in mod_balancer. + * @param r request + * @param params table with the parameters like b=mycluster etc. + * @return 404 when the worker/balancer doesn't exist, + * 400 if something is invalid + * 200 for success. + */ +APR_DECLARE_OPTIONAL_FN(apr_status_t, balancer_manage, + (request_rec *, apr_table_t *params)); /** * @param socket socket to test diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index fb27320cb6..0bff999d80 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -1378,7 +1378,7 @@ static int balancer_process_balancer_worker(request_rec *r, proxy_server_conf *c /* * Process a request for balancer or worker management from another module */ -static int balancer_manage(request_rec *r, apr_table_t *params) +static apr_status_t balancer_manage(request_rec *r, apr_table_t *params) { void *sconf; proxy_server_conf *conf; @@ -2061,7 +2061,7 @@ static void ap_proxy_balancer_register_hook(apr_pool_t *p) static const char *const aszPred[] = { "mpm_winnt.c", "mod_slotmem_shm.c", NULL}; static const char *const aszPred2[] = { "mod_proxy.c", NULL}; /* manager handler */ - ap_register_provider(p, "balancer", "manager", "0", &balancer_manage); + APR_REGISTER_OPTIONAL_FN(balancer_manage); ap_hook_post_config(balancer_post_config, aszPred2, NULL, APR_HOOK_MIDDLE); ap_hook_pre_config(balancer_pre_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_handler(balancer_handler, NULL, NULL, APR_HOOK_FIRST); |