Commit dfc7a34f authored by Jeff Trawick's avatar Jeff Trawick
Browse files

mpm_common.c implements a handful of config directives; the

related state has to be re-initialized to the default values
at pre-config time, but that was handled inconsistently by
the MPMs, resulting in unexpected behavior when some of the
directives were removed across restart

move that necessary initialization from the MPMs to common 
code run from core's pre-config; MPMs that need to override
defaults can do so by running after core's pre-config (the 
NetWare MPM now does that)

the DEFAULT_MAX_REQUESTS_PER_CHILD compile setting wasn't useful
enough to keep

the simple MPM wasn't consistent in which of these directives
were respected and which weren't, and that hasn't changed
(see procmgr.max_requests_per_child vs. ap_max_requests_per_child)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086293 13f79535-47bb-0310-9956-ffa450edef68
parent 60ff186a
Loading
Loading
Loading
Loading
+5 −0
Changes for include/mpm_common.h: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -350,6 +350,11 @@ AP_DECLARE_HOOK(const char *,mpm_get_name,(void))
 */
#define AP_ACCEPT_MUTEX_TYPE "mpm-accept"

/* internal pre-config logic for MPM-related settings, callable only from
 * core's pre-config hook
 */
void mpm_common_pre_config(apr_pool_t *pconf);
  
#ifdef __cplusplus
}
#endif
+2 −0
Changes for server/core.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4150,6 +4150,8 @@ static int core_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptem
    apr_pool_cleanup_register(pconf, NULL, reset_config_defines,
                              apr_pool_cleanup_null);

    mpm_common_pre_config(pconf);

    return APR_SUCCESS;
}

+0 −5
Changes for server/mpm/event/event.c: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -2463,12 +2463,7 @@ static int event_pre_config(apr_pool_t * pconf, apr_pool_t * plog,
    ap_daemons_limit = server_limit;
    threads_per_child = DEFAULT_THREADS_PER_CHILD;
    max_clients = ap_daemons_limit * threads_per_child;
    ap_pid_fname = DEFAULT_PIDLOG;
    ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
    ap_extended_status = 0;
    ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;

    apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));

    return OK;
}
+0 −7
Changes for server/mpm/event/mpm_default.h: 0 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -51,12 +51,5 @@
#define DEFAULT_THREADS_PER_CHILD 25
#endif

/* Number of requests to try to handle in a single process.  If <= 0,
 * the children don't die off.
 */
#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
#endif

#endif /* AP_MPM_DEFAULT_H */
/** @} */
+0 −7
Changes for server/mpm/mpmt_os2/mpm_default.h: 0 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -52,12 +52,5 @@
#define SCOREBOARD_MAINTENANCE_INTERVAL 1000000
#endif

/* Number of requests to try to handle in a single process.  If <= 0,
 * the children don't die off.
 */
#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
#define DEFAULT_MAX_REQUESTS_PER_CHILD 0
#endif

#endif /* AP_MPM_DEFAULT_H */
/** @} */
Loading