Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
mod_watchdog.c File Reference
#include "apr.h"
#include "mod_watchdog.h"
#include "ap_provider.h"
#include "ap_mpm.h"
#include "http_core.h"
#include "util_mutex.h"
#include "apr_atomic.h"

Go to the source code of this file.

Classes

struct  watchdog_list_t
 
struct  ap_watchdog_t
 
struct  wd_server_conf_t
 

Macros

#define AP_WATCHDOG_PGROUP   "watchdog"
 
#define AP_WATCHDOG_PVERSION   "parent"
 
#define AP_WATCHDOG_CVERSION   "child"
 

Typedefs

typedef struct watchdog_list_t watchdog_list_t
 
typedef struct wd_server_conf_t wd_server_conf_t
 

Functions

static apr_status_t wd_worker_cleanup (void *data)
 
static void *APR_THREAD_FUNC wd_worker (apr_thread_t *thread, void *data)
 
static apr_status_t wd_startup (ap_watchdog_t *w, apr_pool_t *p)
 
static apr_status_t ap_watchdog_get_instance (ap_watchdog_t **watchdog, const char *name, int parent, int singleton, apr_pool_t *p)
 
static apr_status_t ap_watchdog_set_callback_interval (ap_watchdog_t *w, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)
 
static apr_status_t ap_watchdog_register_callback (ap_watchdog_t *w, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)
 
static int wd_pre_config_hook (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
 
static int wd_post_config_hook (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 
static void wd_child_init_hook (apr_pool_t *p, server_rec *s)
 
static const charwd_cmd_watchdog_int (cmd_parms *cmd, void *dummy, const char *arg)
 
static void wd_register_hooks (apr_pool_t *p)
 
void ap_hook_watchdog_need (ap_HOOK_watchdog_need_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
apr_array_header_tap_hook_get_watchdog_need (void)
 
int ap_run_watchdog_need (server_rec *s, const char *name, int parent, int singleton)
 
void ap_hook_watchdog_init (ap_HOOK_watchdog_init_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
apr_array_header_tap_hook_get_watchdog_init (void)
 
int ap_run_watchdog_init (server_rec *s, const char *name, apr_pool_t *pool)
 
void ap_hook_watchdog_exit (ap_HOOK_watchdog_exit_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
apr_array_header_tap_hook_get_watchdog_exit (void)
 
int ap_run_watchdog_exit (server_rec *s, const char *name, apr_pool_t *pool)
 
void ap_hook_watchdog_step (ap_HOOK_watchdog_step_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
apr_array_header_tap_hook_get_watchdog_step (void)
 
int ap_run_watchdog_step (server_rec *s, const char *name, apr_pool_t *pool)
 

Variables

static wd_server_conf_twd_server_conf = NULL
 
static apr_interval_time_t wd_interval = APR_INT64_C( 1000000 )
 
static int mpm_is_forked = 0
 
static const charwd_proc_mutex_type = "watchdog-callback"
 
static const command_rec wd_directives []
 
static int *const aplog_module_index = &( watchdog_module.module_index)
 
struct { 
 
   apr_array_header_t *   link_watchdog_need 
 
   apr_array_header_t *   link_watchdog_init 
 
   apr_array_header_t *   link_watchdog_exit 
 
   apr_array_header_t *   link_watchdog_step 
 
_hooks 
 

Macro Definition Documentation

◆ AP_WATCHDOG_CVERSION

#define AP_WATCHDOG_CVERSION   "child"

Definition at line 31 of file mod_watchdog.c.

◆ AP_WATCHDOG_PGROUP

#define AP_WATCHDOG_PGROUP   "watchdog"

Definition at line 29 of file mod_watchdog.c.

◆ AP_WATCHDOG_PVERSION

#define AP_WATCHDOG_PVERSION   "parent"

Definition at line 30 of file mod_watchdog.c.

Typedef Documentation

◆ watchdog_list_t

Definition at line 33 of file mod_watchdog.c.

◆ wd_server_conf_t

Definition at line 60 of file mod_watchdog.c.

Function Documentation

◆ ap_watchdog_get_instance()

static apr_status_t ap_watchdog_get_instance ( ap_watchdog_t **  watchdog,
const char name,
int  parent,
int  singleton,
apr_pool_t p 
)
static

< This value specifies that an * MPM is not capable of * threading or forking.

Definition at line 291 of file mod_watchdog.c.

◆ ap_watchdog_register_callback()

static apr_status_t ap_watchdog_register_callback ( ap_watchdog_t w,
apr_interval_time_t  interval,
const void *  data,
ap_watchdog_callback_fn_t callback 
)
static

Definition at line 346 of file mod_watchdog.c.

◆ ap_watchdog_set_callback_interval()

static apr_status_t ap_watchdog_set_callback_interval ( ap_watchdog_t w,
apr_interval_time_t  interval,
const void *  data,
ap_watchdog_callback_fn_t callback 
)
static

Definition at line 321 of file mod_watchdog.c.

◆ wd_child_init_hook()

static void wd_child_init_hook ( apr_pool_t p,
server_rec s 
)
static

< Module has handled this stage.

Definition at line 551 of file mod_watchdog.c.

◆ wd_cmd_watchdog_int()

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

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 594 of file mod_watchdog.c.

◆ wd_post_config_hook()

static int wd_post_config_hook ( apr_pool_t pconf,
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.

< Module has handled this stage.

Definition at line 425 of file mod_watchdog.c.

◆ wd_pre_config_hook()

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

< This value specifies that an * MPM is not capable of * threading or forking.

< Module has handled this stage.

Definition at line 386 of file mod_watchdog.c.

◆ wd_register_hooks()

static void wd_register_hooks ( apr_pool_t p)
static

Definition at line 636 of file mod_watchdog.c.

◆ wd_startup()

static apr_status_t wd_startup ( ap_watchdog_t w,
apr_pool_t p 
)
static

Definition at line 268 of file mod_watchdog.c.

◆ wd_worker()

static void *APR_THREAD_FUNC wd_worker ( apr_thread_t thread,
void *  data 
)
static

Definition at line 107 of file mod_watchdog.c.

◆ wd_worker_cleanup()

static apr_status_t wd_worker_cleanup ( void *  data)
static

Definition at line 74 of file mod_watchdog.c.

Variable Documentation

◆ [struct]

struct { ... } _hooks

◆ aplog_module_index

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

Definition at line 677 of file mod_watchdog.c.

◆ link_watchdog_exit

apr_array_header_t* link_watchdog_exit

Definition at line 697 of file mod_watchdog.c.

◆ link_watchdog_init

apr_array_header_t* link_watchdog_init

Definition at line 697 of file mod_watchdog.c.

◆ link_watchdog_need

apr_array_header_t* link_watchdog_need

Definition at line 697 of file mod_watchdog.c.

◆ link_watchdog_step

apr_array_header_t* link_watchdog_step

Definition at line 697 of file mod_watchdog.c.

◆ mpm_is_forked

int mpm_is_forked = 0
static

This value specifies that an * MPM is not capable of * threading or forking.

Definition at line 71 of file mod_watchdog.c.

◆ wd_directives

const command_rec wd_directives[]
static
Initial value:
=
{
{ "WatchdogInterval" , wd_cmd_watchdog_int , NULL , 128 , TAKE1, "Watchdog interval in seconds" },
{NULL}
}
@ TAKE1
Definition http_config.h:51
return NULL
Definition mod_so.c:359
static const char * wd_cmd_watchdog_int(cmd_parms *cmd, void *dummy, const char *arg)

Definition at line 619 of file mod_watchdog.c.

◆ wd_interval

apr_interval_time_t wd_interval = APR_INT64_C( 1000000 )
static

Definition at line 70 of file mod_watchdog.c.

◆ wd_proc_mutex_type

const char* wd_proc_mutex_type = "watchdog-callback"
static

Definition at line 72 of file mod_watchdog.c.

◆ wd_server_conf

wd_server_conf_t* wd_server_conf = NULL
static

Definition at line 69 of file mod_watchdog.c.