Apache HTTPD
Classes | Macros | Functions | Variables
scoreboard.c File Reference
#include "apr.h"
#include "apr_strings.h"
#include "apr_portable.h"
#include "apr_lib.h"
#include "apr_want.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_log.h"
#include "http_main.h"
#include "http_core.h"
#include "http_config.h"
#include "http_protocol.h"
#include "ap_mpm.h"
#include "scoreboard.h"

Go to the source code of this file.

Classes

struct  ap_sb_handle_t
 

Macros

#define APR_WANT_STRFUNC
 
#define APLOG_MODULE_INDEX   AP_CORE_MODULE_INDEX
 
#define SIZE_OF_scoreboard   APR_ALIGN_DEFAULT(sizeof(scoreboard))
 
#define SIZE_OF_global_score   APR_ALIGN_DEFAULT(sizeof(global_score))
 
#define SIZE_OF_process_score   APR_ALIGN_DEFAULT(sizeof(process_score))
 
#define SIZE_OF_worker_score   APR_ALIGN_DEFAULT(sizeof(worker_score))
 

Functions

const charap_set_scoreboard (cmd_parms *cmd, void *dummy, const char *arg)
 
const charap_set_extended_status (cmd_parms *cmd, void *dummy, int arg)
 
const charap_set_reqtail (cmd_parms *cmd, void *dummy, int arg)
 
void ap_hook_pre_mpm (ap_HOOK_pre_mpm_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
apr_array_header_tap_hook_get_pre_mpm (void)
 
int ap_run_pre_mpm (apr_pool_t *p, ap_scoreboard_e sb_type)
 
static apr_status_t ap_cleanup_shared_mem (void *d)
 
int ap_calc_scoreboard_size (void)
 
void ap_init_scoreboard (void *shared_score)
 
static apr_status_t create_namebased_scoreboard (apr_pool_t *pool, const char *fname)
 
static apr_status_t open_scoreboard (apr_pool_t *pconf)
 
apr_status_t ap_reopen_scoreboard (apr_pool_t *p, apr_shm_t **shm, int detached)
 
apr_status_t ap_cleanup_scoreboard (void *d)
 
int ap_create_scoreboard (apr_pool_t *p, ap_scoreboard_e sb_type)
 
int ap_exists_scoreboard_image (void)
 
void ap_set_conn_count (ap_sb_handle_t *sb, request_rec *r, unsigned short conn_count)
 
void ap_increment_counts (ap_sb_handle_t *sb, request_rec *r)
 
int ap_find_child_by_pid (apr_proc_t *pid)
 
void ap_update_sb_handle (ap_sb_handle_t *sbh, int child_num, int thread_num)
 
void ap_create_sb_handle (ap_sb_handle_t **new_sbh, apr_pool_t *p, int child_num, int thread_num)
 
static void copy_request (char *rbuf, apr_size_t rbuflen, request_rec *r)
 
static int update_child_status_internal (int child_num, int thread_num, int status, conn_rec *c, server_rec *s, request_rec *r, const char *descr)
 
int ap_update_child_status_from_indexes (int child_num, int thread_num, int status, request_rec *r)
 
int ap_update_child_status (ap_sb_handle_t *sbh, int status, request_rec *r)
 
int ap_update_child_status_from_conn (ap_sb_handle_t *sbh, int status, conn_rec *c)
 
int ap_update_child_status_from_server (ap_sb_handle_t *sbh, int status, conn_rec *c, server_rec *s)
 
int ap_update_child_status_descr (ap_sb_handle_t *sbh, int status, const char *descr)
 
void ap_time_process_request (ap_sb_handle_t *sbh, int status)
 
int ap_update_global_status (void)
 
worker_scoreap_get_scoreboard_worker_from_indexes (int x, int y)
 
worker_scoreap_get_scoreboard_worker (ap_sb_handle_t *sbh)
 
void ap_copy_scoreboard_worker (worker_score *dest, int child_num, int thread_num)
 
process_scoreap_get_scoreboard_process (int x)
 
global_scoreap_get_scoreboard_global (void)
 

Variables

scoreboardap_scoreboard_image = NULL
 
const charap_scoreboard_fname = NULL
 
static ap_scoreboard_e scoreboard_type
 
int ap_extended_status = 0
 
int ap_mod_status_reqtail = 0
 
struct { 
 
   apr_array_header_t *   link_pre_mpm 
 
_hooks 
 
static apr_OFN_ap_logio_get_last_bytes_tpfn_ap_logio_get_last_bytes
 
static int server_limit
 
static int thread_limit
 
static apr_size_t scoreboard_size
 

Macro Definition Documentation

◆ APLOG_MODULE_INDEX

#define APLOG_MODULE_INDEX   AP_CORE_MODULE_INDEX

Definition at line 42 of file scoreboard.c.

◆ APR_WANT_STRFUNC

#define APR_WANT_STRFUNC

Definition at line 22 of file scoreboard.c.

◆ SIZE_OF_global_score

#define SIZE_OF_global_score   APR_ALIGN_DEFAULT(sizeof(global_score))

Definition at line 134 of file scoreboard.c.

◆ SIZE_OF_process_score

#define SIZE_OF_process_score   APR_ALIGN_DEFAULT(sizeof(process_score))

Definition at line 135 of file scoreboard.c.

◆ SIZE_OF_scoreboard

#define SIZE_OF_scoreboard   APR_ALIGN_DEFAULT(sizeof(scoreboard))

Definition at line 133 of file scoreboard.c.

◆ SIZE_OF_worker_score

#define SIZE_OF_worker_score   APR_ALIGN_DEFAULT(sizeof(worker_score))

Definition at line 136 of file scoreboard.c.

Function Documentation

◆ ap_calc_scoreboard_size()

int ap_calc_scoreboard_size ( void  )

Definition at line 138 of file scoreboard.c.

◆ ap_cleanup_scoreboard()

apr_status_t ap_cleanup_scoreboard ( void *  d)

Definition at line 285 of file scoreboard.c.

◆ ap_cleanup_shared_mem()

static apr_status_t ap_cleanup_shared_mem ( void *  d)
static

Definition at line 123 of file scoreboard.c.

◆ ap_copy_scoreboard_worker()

void ap_copy_scoreboard_worker ( worker_score dest,
int  child_num,
int  thread_num 
)

Copy the contents of a worker scoreboard entry. The contents of the worker_score structure are copied verbatim into the dest structure.

Parameters
destOutput parameter.
child_numThe child number.
thread_numThe thread number.

Definition at line 685 of file scoreboard.c.

◆ ap_create_sb_handle()

void ap_create_sb_handle ( ap_sb_handle_t **  new_sbh,
apr_pool_t p,
int  child_num,
int  thread_num 
)

Definition at line 432 of file scoreboard.c.

◆ ap_create_scoreboard()

int ap_create_scoreboard ( apr_pool_t p,
ap_scoreboard_e  sb_type 
)

< Module has handled this stage.

< Module has handled this stage.

Definition at line 304 of file scoreboard.c.

◆ ap_exists_scoreboard_image()

int ap_exists_scoreboard_image ( void  )

Definition at line 362 of file scoreboard.c.

◆ ap_find_child_by_pid()

int ap_find_child_by_pid ( apr_proc_t pid)

Definition at line 409 of file scoreboard.c.

◆ ap_get_scoreboard_global()

global_score * ap_get_scoreboard_global ( void  )

Definition at line 710 of file scoreboard.c.

◆ ap_get_scoreboard_process()

process_score * ap_get_scoreboard_process ( int  x)

Definition at line 702 of file scoreboard.c.

◆ ap_get_scoreboard_worker()

worker_score * ap_get_scoreboard_worker ( ap_sb_handle_t sbh)

Definition at line 676 of file scoreboard.c.

◆ ap_get_scoreboard_worker_from_indexes()

worker_score * ap_get_scoreboard_worker_from_indexes ( int  child_num,
int  thread_num 
)

Return a pointer to the worker_score for a given child, thread pair.

Parameters
child_numThe child number.
thread_numThe thread number.
Returns
A pointer to the worker_score structure.
Deprecated:
This function is deprecated, use ap_copy_scoreboard_worker instead.

Definition at line 667 of file scoreboard.c.

◆ ap_hook_get_pre_mpm()

apr_array_header_t * ap_hook_get_pre_mpm ( void  )

Definition at line 102 of file scoreboard.c.

◆ ap_hook_pre_mpm()

void ap_hook_pre_mpm ( ap_HOOK_pre_mpm_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 102 of file scoreboard.c.

◆ ap_increment_counts()

void ap_increment_counts ( ap_sb_handle_t sb,
request_rec r 
)

RFC 2616: HTTP

Definition at line 379 of file scoreboard.c.

◆ ap_init_scoreboard()

void ap_init_scoreboard ( void *  shared_score)

Definition at line 150 of file scoreboard.c.

◆ ap_reopen_scoreboard()

apr_status_t ap_reopen_scoreboard ( apr_pool_t p,
apr_shm_t **  shm,
int  detached 
)

Definition at line 263 of file scoreboard.c.

◆ ap_run_pre_mpm()

int ap_run_pre_mpm ( apr_pool_t p,
ap_scoreboard_e  sb_type 
)

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

< Module has handled this stage.

Definition at line 102 of file scoreboard.c.

◆ ap_set_conn_count()

void ap_set_conn_count ( ap_sb_handle_t sb,
request_rec r,
unsigned short  conn_count 
)

Definition at line 367 of file scoreboard.c.

◆ ap_set_extended_status()

const char * ap_set_extended_status ( cmd_parms cmd,
void *  dummy,
int  arg 
)

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 63 of file scoreboard.c.

◆ ap_set_reqtail()

const char * ap_set_reqtail ( cmd_parms cmd,
void *  dummy,
int  arg 
)

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 75 of file scoreboard.c.

◆ ap_set_scoreboard()

const char * ap_set_scoreboard ( cmd_parms cmd,
void *  dummy,
const char arg 
)

< Forbidden in <VirtualHost>

< Forbidden in <Limit>

< Forbidden in <Directory>

< Forbidden in <Location>

< Forbidden in <Files> or <If>

< Forbidden in <Proxy>

Definition at line 48 of file scoreboard.c.

◆ ap_time_process_request()

void ap_time_process_request ( ap_sb_handle_t sbh,
int  status 
)

Definition at line 632 of file scoreboard.c.

◆ ap_update_child_status()

int ap_update_child_status ( ap_sb_handle_t sbh,
int  status,
request_rec r 
)

Definition at line 590 of file scoreboard.c.

◆ ap_update_child_status_descr()

int ap_update_child_status_descr ( ap_sb_handle_t sbh,
int  status,
const char descr 
)

Definition at line 623 of file scoreboard.c.

◆ ap_update_child_status_from_conn()

int ap_update_child_status_from_conn ( ap_sb_handle_t sbh,
int  status,
conn_rec c 
)

Definition at line 603 of file scoreboard.c.

◆ ap_update_child_status_from_indexes()

int ap_update_child_status_from_indexes ( int  child_num,
int  thread_num,
int  status,
request_rec r 
)

Definition at line 575 of file scoreboard.c.

◆ ap_update_child_status_from_server()

int ap_update_child_status_from_server ( ap_sb_handle_t sbh,
int  status,
conn_rec c,
server_rec s 
)

Definition at line 613 of file scoreboard.c.

◆ ap_update_global_status()

int ap_update_global_status ( void  )

Definition at line 656 of file scoreboard.c.

◆ ap_update_sb_handle()

void ap_update_sb_handle ( ap_sb_handle_t sbh,
int  child_num,
int  thread_num 
)

Definition at line 425 of file scoreboard.c.

◆ copy_request()

static void copy_request ( char rbuf,
apr_size_t  rbuflen,
request_rec r 
)
static

Definition at line 439 of file scoreboard.c.

◆ create_namebased_scoreboard()

static apr_status_t create_namebased_scoreboard ( apr_pool_t pool,
const char fname 
)
static

Create a name-based scoreboard in the given pool using the given filename.

Definition at line 183 of file scoreboard.c.

◆ open_scoreboard()

static apr_status_t open_scoreboard ( apr_pool_t pconf)
static

Definition at line 208 of file scoreboard.c.

◆ update_child_status_internal()

static int update_child_status_internal ( int  child_num,
int  thread_num,
int  status,
conn_rec c,
server_rec s,
request_rec r,
const char descr 
)
static

Definition at line 475 of file scoreboard.c.

Variable Documentation

◆ [struct]

struct { ... } _hooks

◆ ap_extended_status

int ap_extended_status = 0

Definition at line 61 of file scoreboard.c.

◆ ap_mod_status_reqtail

int ap_mod_status_reqtail = 0

Definition at line 73 of file scoreboard.c.

◆ ap_scoreboard_fname

const char* ap_scoreboard_fname = NULL

Definition at line 45 of file scoreboard.c.

◆ ap_scoreboard_image

scoreboard* ap_scoreboard_image = NULL

Definition at line 44 of file scoreboard.c.

◆ link_pre_mpm

apr_array_header_t* link_pre_mpm

Definition at line 98 of file scoreboard.c.

◆ pfn_ap_logio_get_last_bytes

apr_OFN_ap_logio_get_last_bytes_t* pfn_ap_logio_get_last_bytes
static

Definition at line 105 of file scoreboard.c.

◆ scoreboard_size

apr_size_t scoreboard_size
static

Definition at line 113 of file scoreboard.c.

◆ scoreboard_type

ap_scoreboard_e scoreboard_type
static

Definition at line 46 of file scoreboard.c.

◆ server_limit

int server_limit
static

Definition at line 112 of file scoreboard.c.

◆ thread_limit

int thread_limit
static

Definition at line 112 of file scoreboard.c.