Commit b308b525 authored by Ryan Bloom's avatar Ryan Bloom
Browse files

Make scoreboard creation a hook. This allows management

modules to have access to the scoreboard at the time that it is
created, and at every restart request.
Submitted by:	Cody Sherr <csherr@covalent.net>
Reviewed by:	Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89608 13f79535-47bb-0310-9956-ffa450edef68
parent a47720db
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.21-dev

  *) Make scoreboard creation a hook.  This allows management
     modules to have access to the scoreboard at the time that it is
     created, and at every restart request.  
     [Cody Sherr <csherr@covalent.net>]

  *) Changed AP_MPMQ_MAX_DAEMONS to refer to MaxClients and
     added an AP_MPMQ_MAX_DAEMON_USED to refer to the highest
     daemon index actually used in the scoreboard. I also
+11 −0
Original line number Diff line number Diff line
@@ -69,7 +69,9 @@ extern "C" {
#include <time.h>
#endif

#include "ap_config.h"
#include "mpm_default.h"	/* For HARD_.*_LIMIT */
#include "apr_hooks.h"
#include "apr_thread_proc.h"
#include "apr_portable.h"

@@ -221,6 +223,15 @@ AP_DECLARE_DATA extern apr_time_t ap_restart_time;

AP_DECLARE_DATA extern ap_generation_t volatile ap_my_generation;

/* Hooks */
/**
  * Hook for post scoreboard creation, pre mpm.
  * @param p       Apache pool to allocate from.
  * @param sb_type 
  * @ingroup hooks
  */  
AP_DECLARE_HOOK(void, pre_mpm, (apr_pool_t *p, ap_scoreboard_e sb_type))

/* for time_process_request() in http_main.c */
#define START_PREQUEST 1
#define STOP_PREQUEST  2
+1 −0
Original line number Diff line number Diff line
@@ -3319,6 +3319,7 @@ static void register_hooks(apr_pool_t *p)
    ap_hook_type_checker(do_nothing,NULL,NULL,APR_HOOK_REALLY_LAST);
    ap_hook_access_checker(do_nothing,NULL,NULL,APR_HOOK_REALLY_LAST);
    ap_hook_create_request(core_create_req, NULL, NULL, APR_HOOK_MIDDLE);
    ap_hook_pre_mpm(ap_create_scoreboard, NULL, NULL, APR_HOOK_MIDDLE);

    /* register the core's insert_filter hook and register core-provided
     * filters
+1 −1
Original line number Diff line number Diff line
@@ -767,7 +767,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
     */
    
    if (!is_graceful)
        ap_create_scoreboard(pconf, SB_SHARED);
        ap_run_pre_mpm(pconf, SB_SHARED);

    if (!is_graceful) {
        for (i = 0; i < HARD_SERVER_LIMIT; i++) {
+1 −1
Original line number Diff line number Diff line
@@ -1211,7 +1211,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
    }

    if (!is_graceful) {
        ap_create_scoreboard(pconf, SB_SHARED);
        ap_run_pre_mpm(pconf, SB_SHARED);
    }
    /* Initialize the child table */
    if (!is_graceful) {
Loading