From: William A. Rowe Jr Date: Wed, 6 Feb 2002 19:06:39 +0000 (+0000) Subject: Move around a bit of code so I can follow it better. -> EOF should always X-Git-Tag: 2.0.32~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d38559393ea3ec8636fb52b295f0738af949ee1b;p=apache Move around a bit of code so I can follow it better. -> EOF should always take us to the module struct, and working backwards, the register hooks and then top-level init stuff. At least that's how any other Apache module is authored. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93306 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 7430540d61..4fe24ffb23 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -143,6 +143,65 @@ static PCOMP_CONTEXT qhead = NULL; static PCOMP_CONTEXT qtail = NULL; static int num_completion_contexts = 0; static HANDLE ThreadDispatchIOCP = NULL; + +/* Stub functions until this MPM supports the connection status API */ + +AP_DECLARE(void) ap_update_connection_status(long conn_id, const char *key, \ + const char *value) +{ + /* NOP */ +} + +AP_DECLARE(void) ap_reset_connection_status(long conn_id) +{ + /* NOP */ +} + +AP_DECLARE(apr_array_header_t *) ap_get_status_table(apr_pool_t *p) +{ + /* NOP */ + return NULL; +} + +/* + * Command processors + */ + +static const char *set_threads_per_child (cmd_parms *cmd, void *dummy, char *arg) +{ + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); + if (err != NULL) { + return err; + } + + ap_threads_per_child = atoi(arg); + if (ap_threads_per_child > HARD_THREAD_LIMIT) { + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "WARNING: ThreadsPerChild of %d exceeds compile time" + " limit of %d threads,", ap_threads_per_child, + HARD_THREAD_LIMIT); + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + " lowering ThreadsPerChild to %d. To increase, please" + " see the HARD_THREAD_LIMIT define in %s.", + HARD_THREAD_LIMIT, AP_MPM_HARD_LIMITS_FILE); + ap_threads_per_child = HARD_THREAD_LIMIT; + } + else if (ap_threads_per_child < 1) { + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "WARNING: Require ThreadsPerChild > 0, setting to 1"); + ap_threads_per_child = 1; + } + return NULL; +} + +static const command_rec winnt_cmds[] = { +LISTEN_COMMANDS, +{ "ThreadsPerChild", set_threads_per_child, NULL, RSRC_CONF, TAKE1, + "Number of threads each child creates" }, +{ NULL } +}; + + AP_DECLARE(void) mpm_recycle_completion_context(PCOMP_CONTEXT pCompContext) { /* Recycle the completion context. @@ -2314,63 +2373,6 @@ static void winnt_hooks(apr_pool_t *p) ap_hook_open_logs(winnt_open_logs, NULL, aszSucc, APR_HOOK_MIDDLE); } -/* - * Command processors - */ - -static const char *set_threads_per_child (cmd_parms *cmd, void *dummy, char *arg) -{ - const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); - if (err != NULL) { - return err; - } - - ap_threads_per_child = atoi(arg); - if (ap_threads_per_child > HARD_THREAD_LIMIT) { - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, - "WARNING: ThreadsPerChild of %d exceeds compile time" - " limit of %d threads,", ap_threads_per_child, - HARD_THREAD_LIMIT); - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, - " lowering ThreadsPerChild to %d. To increase, please" - " see the HARD_THREAD_LIMIT define in %s.", - HARD_THREAD_LIMIT, AP_MPM_HARD_LIMITS_FILE); - ap_threads_per_child = HARD_THREAD_LIMIT; - } - else if (ap_threads_per_child < 1) { - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, - "WARNING: Require ThreadsPerChild > 0, setting to 1"); - ap_threads_per_child = 1; - } - return NULL; -} - -/* Stub functions until this MPM supports the connection status API */ - -AP_DECLARE(void) ap_update_connection_status(long conn_id, const char *key, \ - const char *value) -{ - /* NOP */ -} - -AP_DECLARE(void) ap_reset_connection_status(long conn_id) -{ - /* NOP */ -} - -AP_DECLARE(apr_array_header_t *) ap_get_status_table(apr_pool_t *p) -{ - /* NOP */ - return NULL; -} - -static const command_rec winnt_cmds[] = { -LISTEN_COMMANDS, -{ "ThreadsPerChild", set_threads_per_child, NULL, RSRC_CONF, TAKE1, - "Number of threads each child creates" }, -{ NULL } -}; - AP_MODULE_DECLARE_DATA module mpm_winnt_module = { MPM20_MODULE_STUFF, winnt_rewrite_args, /* hook to run before apache parses args */