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
/* 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 */
/**
"<tt>connection: %d "
"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());
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:
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;
}
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:
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;
}
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:
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;
}
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_daemons_limit;
return APR_SUCCESS;
case AP_MPMQ_IS_THREADED:
case AP_MPMQ_MAX_REQUESTS_DEAMON:
*result = ap_max_requests_per_child;
return APR_SUCCESS;
+ case AP_MPMQ_MAX_DAEMONS:
+ *result = ap_daemons_limit;
+ return APR_SUCCESS;
}
return APR_ENOTIMPL;
}
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 = max_daemons_limit;
return APR_SUCCESS;
case AP_MPMQ_IS_THREADED:
case AP_MPMQ_MAX_REQUESTS_DEAMON:
*result = ap_max_requests_per_child;
return APR_SUCCESS;
+ case AP_MPMQ_MAX_DAEMONS:
+ *result = ap_daemons_limit;
+ return APR_SUCCESS;
}
return APR_ENOTIMPL;
}
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:
case AP_MPMQ_MAX_REQUESTS_DEAMON:
*result = ap_max_requests_per_child;
return APR_SUCCESS;
+ case AP_MPMQ_MAX_DAEMONS:
+ *result = ap_daemons_limit;
+ return APR_SUCCESS;
}
return APR_ENOTIMPL;
}
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 = MAXIMUM_WAIT_OBJECTS;
return APR_SUCCESS;
case AP_MPMQ_IS_THREADED:
case AP_MPMQ_MAX_REQUESTS_DEAMON:
*result = ap_max_requests_per_child;
return APR_SUCCESS;
+ case AP_MPMQ_MAX_DAEMONS:
+ *result = 0;
+ return APR_SUCCESS;
}
return APR_ENOTIMPL;
}
int not_dead_yet;
int max_daemons;
- ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons);
+ ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons);
MPM_SYNC_CHILD_TABLE();
for (tries = terminate ? 4 : 1; tries <= 9; ++tries) {
int i;
int max_daemons_limit;
- ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons_limit);
+ ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons_limit);
for (i = 0; i < max_daemons_limit; ++i)
if (ap_scoreboard_image->parent[i].pid == pid->pid)