Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
mod_lbmethod_heartbeat.c File Reference
#include "mod_proxy.h"
#include "scoreboard.h"
#include "ap_mpm.h"
#include "apr_version.h"
#include "ap_hooks.h"
#include "ap_slotmem.h"
#include "heartbeat.h"

Go to the source code of this file.

Classes

struct  lb_hb_ctx_t
 
struct  hb_server_t
 
struct  ctx_servers
 

Macros

#define LBM_HEARTBEAT_MAX_LASTSEEN   (10)
 

Typedefs

typedef struct lb_hb_ctx_t lb_hb_ctx_t
 
typedef struct hb_server_t hb_server_t
 
typedef struct ctx_servers ctx_servers_t
 

Functions

static void argstr_to_table (apr_pool_t *p, char *str, apr_table_t *parms)
 
static apr_status_t readfile_heartbeats (const char *path, apr_hash_t *servers, apr_pool_t *pool)
 
static apr_status_t hm_read (void *mem, void *data, apr_pool_t *pool)
 
static apr_status_t readslot_heartbeats (ctx_servers_t *ctx, apr_pool_t *pool)
 
static apr_status_t read_heartbeats (const char *path, apr_hash_t *servers, apr_pool_t *pool)
 
static proxy_workerfind_best_hb (proxy_balancer *balancer, request_rec *r)
 
static apr_status_t reset (proxy_balancer *balancer, server_rec *s)
 
static apr_status_t age (proxy_balancer *balancer, server_rec *s)
 
static int lb_hb_init (apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 
static void register_hooks (apr_pool_t *p)
 
static void * lb_hb_create_config (apr_pool_t *p, server_rec *s)
 
static void * lb_hb_merge_config (apr_pool_t *p, void *basev, void *overridesv)
 
static const charcmd_lb_hb_storage (cmd_parms *cmd, void *dconf, const char *path)
 

Variables

static int(* ap_proxy_retry_worker_fn )(const char *proxy_function, proxy_worker *worker, server_rec *s) = NULL
 
static const ap_slotmem_provider_tstorage = NULL
 
static ap_slotmem_instance_thm_serversmem = NULL
 
static const proxy_balancer_method heartbeat
 
static const command_rec cmds []
 
static int *const aplog_module_index = &( lbmethod_heartbeat_module.module_index)
 

Macro Definition Documentation

◆ LBM_HEARTBEAT_MAX_LASTSEEN

#define LBM_HEARTBEAT_MAX_LASTSEEN   (10)

Definition at line 29 of file mod_lbmethod_heartbeat.c.

Typedef Documentation

◆ ctx_servers_t

◆ hb_server_t

◆ lb_hb_ctx_t

Function Documentation

◆ age()

static apr_status_t age ( proxy_balancer balancer,
server_rec s 
)
static

Definition at line 347 of file mod_lbmethod_heartbeat.c.

◆ argstr_to_table()

static void argstr_to_table ( apr_pool_t p,
char str,
apr_table_t parms 
)
static

Definition at line 65 of file mod_lbmethod_heartbeat.c.

◆ cmd_lb_hb_storage()

static const char * cmd_lb_hb_storage ( cmd_parms cmd,
void *  dconf,
const char path 
)
static

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 431 of file mod_lbmethod_heartbeat.c.

◆ find_best_hb()

static proxy_worker * find_best_hb ( proxy_balancer balancer,
request_rec r 
)
static

Definition at line 257 of file mod_lbmethod_heartbeat.c.

◆ hm_read()

static apr_status_t hm_read ( void *  mem,
void *  data,
apr_pool_t pool 
)
static

Definition at line 212 of file mod_lbmethod_heartbeat.c.

◆ lb_hb_create_config()

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

Definition at line 406 of file mod_lbmethod_heartbeat.c.

◆ lb_hb_init()

static int lb_hb_init ( apr_pool_t p,
apr_pool_t plog,
apr_pool_t ptemp,
server_rec s 
)
static

< Module has handled this stage.

< Module has handled this stage.

< Module has handled this stage.

Definition at line 362 of file mod_lbmethod_heartbeat.c.

◆ lb_hb_merge_config()

static void * lb_hb_merge_config ( apr_pool_t p,
void *  basev,
void *  overridesv 
)
static

Definition at line 415 of file mod_lbmethod_heartbeat.c.

◆ read_heartbeats()

static apr_status_t read_heartbeats ( const char path,
apr_hash_t servers,
apr_pool_t pool 
)
static

Definition at line 243 of file mod_lbmethod_heartbeat.c.

◆ readfile_heartbeats()

static apr_status_t readfile_heartbeats ( const char path,
apr_hash_t servers,
apr_pool_t pool 
)
static

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open the file for buffered I/O

<

Deprecated:
See also
APR_FOPEN_BUFFERED

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< Size of the file

Definition at line 92 of file mod_lbmethod_heartbeat.c.

◆ readslot_heartbeats()

static apr_status_t readslot_heartbeats ( ctx_servers_t ctx,
apr_pool_t pool 
)
static

Definition at line 235 of file mod_lbmethod_heartbeat.c.

◆ register_hooks()

static void register_hooks ( apr_pool_t p)
static

Definition at line 399 of file mod_lbmethod_heartbeat.c.

◆ reset()

static apr_status_t reset ( proxy_balancer balancer,
server_rec s 
)
static

Definition at line 342 of file mod_lbmethod_heartbeat.c.

Variable Documentation

◆ ap_proxy_retry_worker_fn

int(* ap_proxy_retry_worker_fn) (const char *proxy_function, proxy_worker *worker, server_rec *s) ( const char proxy_function,
proxy_worker worker,
server_rec s 
) = NULL
static

Definition at line 34 of file mod_lbmethod_heartbeat.c.

◆ aplog_module_index

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

Definition at line 456 of file mod_lbmethod_heartbeat.c.

◆ cmds

const command_rec cmds[]
static
Initial value:
= {
{ "HeartbeatStorage" , cmd_lb_hb_storage , NULL , 128 , TAKE1, "Path to read heartbeat data." },
{NULL}
}
@ TAKE1
Definition http_config.h:51
static const char * cmd_lb_hb_storage(cmd_parms *cmd, void *dconf, const char *path)
return NULL
Definition mod_so.c:359

Definition at line 450 of file mod_lbmethod_heartbeat.c.

◆ heartbeat

const proxy_balancer_method heartbeat
static
Initial value:
=
{
"heartbeat",
&age,
}
static apr_status_t age(proxy_balancer *balancer, server_rec *s)
static proxy_worker * find_best_hb(proxy_balancer *balancer, request_rec *r)
static apr_status_t reset(proxy_balancer *balancer, server_rec *s)

Definition at line 352 of file mod_lbmethod_heartbeat.c.

◆ hm_serversmem

ap_slotmem_instance_t* hm_serversmem = NULL
static

Definition at line 38 of file mod_lbmethod_heartbeat.c.

◆ storage

const ap_slotmem_provider_t* storage = NULL
static

Definition at line 37 of file mod_lbmethod_heartbeat.c.