Apache HTTPD
Classes | Macros | Functions | Variables
mod_proxy_hcheck.c File Reference
#include "mod_proxy.h"
#include "mod_watchdog.h"
#include "ap_slotmem.h"
#include "ap_expr.h"
#include "http_ssl.h"

Go to the source code of this file.

Classes

struct  hc_template_t
 
struct  hc_condition_t
 
struct  sctx_t
 
struct  wctx_t
 
struct  baton_t
 

Macros

#define HCHECK_WATHCHDOG_NAME   ("_proxy_hcheck_")
 
#define HC_THREADPOOL_SIZE   (16)
 
#define HC_USE_THREADS   0
 

Functions

static void * hc_create_config (apr_pool_t *p, server_rec *s)
 
static const charset_worker_hc_param (apr_pool_t *p, server_rec *s, proxy_worker *worker, const char *key, const char *val, void *v)
 
static const charset_hc_condition (cmd_parms *cmd, void *dummy, const char *arg)
 
static const charset_hc_template (cmd_parms *cmd, void *dummy, const char *arg)
 
static request_reccreate_request_rec (apr_pool_t *p, server_rec *s, proxy_balancer *balancer, const char *method, const char *protocol)
 
static void set_request_connection (request_rec *r, conn_rec *conn)
 
static void create_hcheck_req (wctx_t *wctx, proxy_worker *hc, apr_pool_t *p)
 
static proxy_workerhc_get_hcworker (sctx_t *ctx, proxy_worker *worker, apr_pool_t *p)
 
static int hc_determine_connection (const char *proxy_function, proxy_conn_rec *backend, server_rec *s)
 
static apr_status_t backend_cleanup (const char *proxy_function, proxy_conn_rec *backend, server_rec *s, int status)
 
static int hc_get_backend (const char *proxy_function, proxy_conn_rec **backend, proxy_worker *hc, sctx_t *ctx)
 
static apr_status_t hc_init_baton (baton_t *baton)
 
static apr_status_t hc_check_cping (baton_t *baton, apr_thread_t *thread)
 
static apr_status_t hc_check_tcp (baton_t *baton)
 
static int hc_send (request_rec *r, const char *out, apr_bucket_brigade *bb)
 
static int hc_read_headers (request_rec *r)
 
static int hc_read_body (request_rec *r, apr_bucket_brigade *bb)
 
static apr_status_t hc_check_http (baton_t *baton, apr_thread_t *thread)
 
static void *APR_THREAD_FUNC hc_check (apr_thread_t *thread, void *b)
 
static apr_status_t hc_watchdog_callback (int state, void *data, apr_pool_t *pool)
 
static int hc_pre_config (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 
static int hc_post_config (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_s)
 
static void hc_show_exprs (request_rec *r)
 
static void hc_select_exprs (request_rec *r, const char *expr)
 
static int hc_valid_expr (request_rec *r, const char *expr)
 
static const charhc_get_body (request_rec *r)
 
static const charhc_expr_var_fn (ap_expr_eval_ctx_t *ctx, const void *data)
 
static const charhc_expr_func_fn (ap_expr_eval_ctx_t *ctx, const void *data, const char *arg)
 
static int hc_expr_lookup (ap_expr_lookup_parms *parms)
 
static void hc_register_hooks (apr_pool_t *p)
 

Variables

static apr_OFN_ajp_handle_cping_cpong_tajp_handle_cping_cpong = NULL
 
static ap_watchdog_twatchdog
 
static const command_rec command_table []
 
static int *const aplog_module_index = &( proxy_hcheck_module.module_index)
 

Macro Definition Documentation

◆ HC_THREADPOOL_SIZE

#define HC_THREADPOOL_SIZE   (16)

Definition at line 28 of file mod_proxy_hcheck.c.

◆ HC_USE_THREADS

#define HC_USE_THREADS   0

Definition at line 36 of file mod_proxy_hcheck.c.

◆ HCHECK_WATHCHDOG_NAME

#define HCHECK_WATHCHDOG_NAME   ("_proxy_hcheck_")

Definition at line 27 of file mod_proxy_hcheck.c.

Function Documentation

◆ backend_cleanup()

static apr_status_t backend_cleanup ( const char proxy_function,
proxy_conn_rec backend,
server_rec s,
int  status 
)
static

< Module has handled this stage.

Definition at line 579 of file mod_proxy_hcheck.c.

◆ create_hcheck_req()

static void create_hcheck_req ( wctx_t wctx,
proxy_worker hc,
apr_pool_t p 
)
static

Definition at line 429 of file mod_proxy_hcheck.c.

◆ create_request_rec()

static request_rec * create_request_rec ( apr_pool_t p,
server_rec s,
proxy_balancer balancer,
const char method,
const char protocol 
)
static

< Origin response

RFC 2616: HTTP

Definition at line 344 of file mod_proxy_hcheck.c.

◆ hc_check()

static void *APR_THREAD_FUNC hc_check ( apr_thread_t thread,
void *  b 
)
static

Definition at line 921 of file mod_proxy_hcheck.c.

◆ hc_check_cping()

static apr_status_t hc_check_cping ( baton_t baton,
apr_thread_t thread 
)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

Definition at line 658 of file mod_proxy_hcheck.c.

◆ hc_check_http()

static apr_status_t hc_check_http ( baton_t baton,
apr_thread_t thread 
)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

Definition at line 841 of file mod_proxy_hcheck.c.

◆ hc_check_tcp()

static apr_status_t hc_check_tcp ( baton_t baton)
static

< Module has handled this stage.

Definition at line 701 of file mod_proxy_hcheck.c.

◆ hc_create_config()

static void * hc_create_config ( apr_pool_t p,
server_rec s 
)
static

Definition at line 82 of file mod_proxy_hcheck.c.

◆ hc_determine_connection()

static int hc_determine_connection ( const char proxy_function,
proxy_conn_rec backend,
server_rec s 
)
static

< Module has handled this stage.

< Module has handled this stage.

Definition at line 554 of file mod_proxy_hcheck.c.

◆ hc_expr_func_fn()

static const char * hc_expr_func_fn ( ap_expr_eval_ctx_t ctx,
const void *  data,
const char arg 
)
static

Definition at line 1295 of file mod_proxy_hcheck.c.

◆ hc_expr_lookup()

static int hc_expr_lookup ( ap_expr_lookup_parms parms)
static

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

Definition at line 1306 of file mod_proxy_hcheck.c.

◆ hc_expr_var_fn()

static const char * hc_expr_var_fn ( ap_expr_eval_ctx_t ctx,
const void *  data 
)
static

Definition at line 1285 of file mod_proxy_hcheck.c.

◆ hc_get_backend()

static int hc_get_backend ( const char proxy_function,
proxy_conn_rec **  backend,
proxy_worker hc,
sctx_t ctx 
)
static

< Module has handled this stage.

< Module has handled this stage.

Definition at line 597 of file mod_proxy_hcheck.c.

◆ hc_get_body()

static const char * hc_get_body ( request_rec r)
static

Definition at line 1262 of file mod_proxy_hcheck.c.

◆ hc_get_hcworker()

static proxy_worker * hc_get_hcworker ( sctx_t ctx,
proxy_worker worker,
apr_pool_t p 
)
static

Definition at line 482 of file mod_proxy_hcheck.c.

◆ hc_init_baton()

static apr_status_t hc_init_baton ( baton_t baton)
static

Definition at line 619 of file mod_proxy_hcheck.c.

◆ hc_post_config()

static int hc_post_config ( apr_pool_t p,
apr_pool_t plog,
apr_pool_t ptemp,
server_rec main_s 
)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

Definition at line 1125 of file mod_proxy_hcheck.c.

◆ hc_pre_config()

static int hc_pre_config ( apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptemp 
)
static

< Module has handled this stage.

Definition at line 1104 of file mod_proxy_hcheck.c.

◆ hc_read_body()

static int hc_read_body ( request_rec r,
apr_bucket_brigade bb 
)
static

< Module has handled this stage.

< Module has handled this stage.

Definition at line 794 of file mod_proxy_hcheck.c.

◆ hc_read_headers()

static int hc_read_headers ( request_rec r)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

Definition at line 730 of file mod_proxy_hcheck.c.

◆ hc_register_hooks()

static void hc_register_hooks ( apr_pool_t p)
static

Definition at line 1343 of file mod_proxy_hcheck.c.

◆ hc_select_exprs()

static void hc_select_exprs ( request_rec r,
const char expr 
)
static

Definition at line 1213 of file mod_proxy_hcheck.c.

◆ hc_send()

static int hc_send ( request_rec r,
const char out,
apr_bucket_brigade bb 
)
static

< Module has handled this stage.

< Module has handled this stage.

Definition at line 716 of file mod_proxy_hcheck.c.

◆ hc_show_exprs()

static void hc_show_exprs ( request_rec r)
static

Definition at line 1182 of file mod_proxy_hcheck.c.

◆ hc_valid_expr()

static int hc_valid_expr ( request_rec r,
const char expr 
)
static

Definition at line 1238 of file mod_proxy_hcheck.c.

◆ hc_watchdog_callback()

static apr_status_t hc_watchdog_callback ( int  state,
void *  data,
apr_pool_t pool 
)
static

Definition at line 987 of file mod_proxy_hcheck.c.

◆ set_hc_condition()

static const char * set_hc_condition ( cmd_parms cmd,
void *  dummy,
const char arg 
)
static

< Forbidden in .htaccess files

Definition at line 234 of file mod_proxy_hcheck.c.

◆ set_hc_template()

static const char * set_hc_template ( cmd_parms cmd,
void *  dummy,
const char arg 
)
static

< Forbidden in .htaccess files

Definition at line 277 of file mod_proxy_hcheck.c.

◆ set_request_connection()

static void set_request_connection ( request_rec r,
conn_rec conn 
)
static

Definition at line 416 of file mod_proxy_hcheck.c.

◆ set_worker_hc_param()

static const char * set_worker_hc_param ( apr_pool_t p,
server_rec s,
proxy_worker worker,
const char key,
const char val,
void *  v 
)
static

Definition at line 105 of file mod_proxy_hcheck.c.

Variable Documentation

◆ ajp_handle_cping_cpong

apr_OFN_ajp_handle_cping_cpong_t* ajp_handle_cping_cpong = NULL
static

Definition at line 80 of file mod_proxy_hcheck.c.

◆ aplog_module_index

int* const aplog_module_index = &( proxy_hcheck_module.module_index)
static

Definition at line 1358 of file mod_proxy_hcheck.c.

◆ command_table

const command_rec command_table[]
static
Initial value:
= {
{ "ProxyHCTemplate" , set_hc_template , NULL , 4 , RAW_ARGS, "Health check template" },
{ "ProxyHCExpr" , set_hc_condition , NULL , 4 , RAW_ARGS, "Define a health check condition ruleset expression" },
{ NULL }
}
@ RAW_ARGS
Definition http_config.h:50
static const char * set_hc_template(cmd_parms *cmd, void *dummy, const char *arg)
static const char * set_hc_condition(cmd_parms *cmd, void *dummy, const char *arg)
return NULL
Definition mod_so.c:359

Definition at line 1331 of file mod_proxy_hcheck.c.

◆ watchdog

ap_watchdog_t* watchdog
static

Definition at line 94 of file mod_proxy_hcheck.c.