@@ -107,6 +107,13 @@ static mem_t *hoststatsmem = NULL;
107107static mem_t * balancerstatsmem = NULL ;
108108static mem_t * sessionidstatsmem = NULL ;
109109static mem_t * domainstatsmem = NULL ;
110+ /* Used for HCExpr templates with lbmethod_cluster */
111+ static apr_table_t * proxyhctemplate = NULL ;
112+
113+ static void set_proxyhctemplate (apr_pool_t * p , apr_table_t * t )
114+ {
115+ proxyhctemplate = apr_table_overlay (p , t , proxyhctemplate );
116+ }
110117
111118static slotmem_storage_method * storage = NULL ;
112119static balancer_method * balancerhandler = NULL ;
@@ -540,6 +547,7 @@ static int manager_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *p
540547 (void )ptemp ;
541548 ap_mutex_register (pconf , node_mutex_type , NULL , APR_LOCK_DEFAULT , 0 );
542549 ap_mutex_register (pconf , context_mutex_type , NULL , APR_LOCK_DEFAULT , 0 );
550+ proxyhctemplate = apr_table_make (plog , 1 );
543551 return OK ;
544552}
545553
@@ -910,6 +918,11 @@ static int is_same_worker_existing(const request_rec *r, const nodeinfo_t *node)
910918static apr_status_t mod_manager_manage_worker (request_rec * r , const nodeinfo_t * node , const balancerinfo_t * bal )
911919{
912920 apr_table_t * params ;
921+ apr_status_t rv ;
922+ int i ;
923+ const apr_array_header_t * h ;
924+ const apr_table_entry_t * entries ;
925+
913926 params = apr_table_make (r -> pool , 10 );
914927 /* balancer */
915928 apr_table_set (params , "b" , node -> mess .balancer );
@@ -938,6 +951,17 @@ static apr_status_t mod_manager_manage_worker(request_rec *r, const nodeinfo_t *
938951
939952 /* Use 10 sec for the moment, the idea is to adjust it with the STATUS frequency */
940953 apr_table_set (params , "w_hi" , "10000" );
954+
955+ h = apr_table_elts (proxyhctemplate );
956+ entries = (const apr_table_entry_t * )h -> elts ;
957+
958+ for (i = 0 ; i < h -> nelts ; i ++ ) {
959+ const char * key = translate_balancer_params (entries [i ].key );
960+ if (key != NULL ) {
961+ apr_table_set (params , key , entries [i ].val );
962+ }
963+ }
964+
941965 return balancer_manage (r , params );
942966}
943967
@@ -3935,6 +3959,7 @@ static void manager_hooks(apr_pool_t *p)
39353959 ap_register_provider (p , "manager" , "shared" , "3" , & balancer_storage );
39363960 ap_register_provider (p , "manager" , "shared" , "4" , & sessionid_storage );
39373961 ap_register_provider (p , "manager" , "shared" , "5" , & domain_storage );
3962+ ap_register_provider (p , "manager" , "shared" , "6" , & set_proxyhctemplate );
39383963}
39393964
39403965/*
0 commit comments