Commit 31207361 authored by Paul J. Reder's avatar Paul J. Reder
Browse files

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
updated the pertinent calls.

Paul J. Reder


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

  *) 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
     updated the pertinent calls. [Paul J. Reder]

  *) Win32: Prevent listening sockets from being inherited by
     the Apache child process, CGI scripts, rotatelog process
     etc.  If the Apache child process segfaults, any processes 
+3 −2
Original line number Diff line number Diff line
@@ -158,17 +158,18 @@ AP_DECLARE(apr_status_t) ap_os_create_privileged_process(
                                      /* an MPM is using a dynamic #  */
                                      /* threads or daemons.          */

#define AP_MPMQ_MAX_DAEMONS           1  /* Max # of daemons             */
#define AP_MPMQ_MAX_DAEMON_USED       1  /* Max # of daemons used so far */
#define AP_MPMQ_IS_THREADED           2  /* MPM can do threading         */
#define AP_MPMQ_IS_FORKED             3  /* MPM can do forking           */
#define AP_MPMQ_HARD_LIMIT_DAEMONS    4  /* The compiled max # deamons   */
#define AP_MPMQ_HARD_LIMIT_THREADS    5  /* The compiled max # threads   */
#define AP_MPMQ_MAX_THREADS           6  /* Max # of threads             */
#define AP_MPMQ_MAX_THREADS           6  /* # of threads/child by config */
#define AP_MPMQ_MIN_SPARE_DEAMONS     7  /* Min # of spare daemons       */
#define AP_MPMQ_MIN_SPARE_THREADS     8  /* Min # of spare threads       */
#define AP_MPMQ_MAX_SPARE_DAEMONS     9  /* Max # of spare daemons       */
#define AP_MPMQ_MAX_SPARE_THREADS    10  /* Max # of spare threads       */
#define AP_MPMQ_MAX_REQUESTS_DEAMON  11  /* Max # of requests per daemon */
#define AP_MPMQ_MAX_DAEMONS          12  /* Max # of daemons by config   */


/**
+1 −1
Original line number Diff line number Diff line
@@ -415,7 +415,7 @@ static int display_info(request_rec *r)
                        "<tt>connection: %d &nbsp;&nbsp; "
                        "keep-alive: %d</tt><br>",
                        serv->timeout, serv->keep_alive_timeout);
            ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons);
            ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons);
            ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded);
            ap_mpm_query(AP_MPMQ_IS_FORKED, &forked);
            ap_rprintf(r, "MPM used is %s<br>\n", ap_show_mpm());
+4 −1
Original line number Diff line number Diff line
@@ -653,7 +653,7 @@ static void server_main_loop(int remaining_threads_to_start)
AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
{
    switch(query_code){
        case AP_MPMQ_MAX_DAEMONS:
        case AP_MPMQ_MAX_DAEMON_USED:
            *result = ap_max_child_assigned;
            return APR_SUCCESS;
        case AP_MPMQ_IS_THREADED:
@@ -686,6 +686,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
        case AP_MPMQ_MAX_REQUESTS_DEAMON:
            *result = ap_max_requests_per_child;
            return APR_SUCCESS;
        case AP_MPMQ_MAX_DAEMONS:
            *result = ap_thread_limit;
            return APR_SUCCESS;
    }
    return APR_ENOTIMPL;
}
+4 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ static apr_lock_t *thread_accept_mutex;
AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
{
    switch(query_code){
        case AP_MPMQ_MAX_DAEMONS:
        case AP_MPMQ_MAX_DAEMON_USED:
            *result = ap_max_daemons_limit;
            return APR_SUCCESS;
        case AP_MPMQ_IS_THREADED:
@@ -255,6 +255,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
        case AP_MPMQ_MAX_REQUESTS_DEAMON:
            *result = max_requests_per_child;
            return APR_SUCCESS; 
        case AP_MPMQ_MAX_DAEMONS:
            *result = num_daemons;
            return APR_SUCCESS;
    }
    return APR_ENOTIMPL;
}
Loading