From: Brian Havard Date: Tue, 3 Nov 2009 13:29:31 +0000 (+0000) Subject: Brind OS/2 MPM up to date with current API. X-Git-Tag: 2.3.3~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=392910c73c0f37b9f89f1a5f53a27d876e123481;p=apache Brind OS/2 MPM up to date with current API. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832409 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index 963bb18e7a..b855368492 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -31,7 +31,7 @@ fi dnl See if this is a forking platform w.r.t. MPMs case $host in - *mingw32*) + *mingw32* | *os2-emx*) forking_mpms_supported=no ;; *) diff --git a/server/mpm/mpmt_os2/mpm.h b/server/mpm/mpmt_os2/mpm.h deleted file mode 100644 index f8bbc30eb3..0000000000 --- a/server/mpm/mpmt_os2/mpm.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file mpmt_os2/mpm.h - * @brief MPM for os2 - * - * @defgroup APACHE_MPM_OS2 os2 MPM - * @ingroup APACHE_OS_OS2 APACHE_MPM - */ - -#ifndef APACHE_MPM_MPMT_OS2_H -#define APACHE_MPM_MPMT_OS2_H - -#define MPMT_OS2_MPM - -#include "httpd.h" -#include "mpm_default.h" -#include "scoreboard.h" - -#define MPM_NAME "MPMT_OS2" - -extern server_rec *ap_server_conf; -#define AP_MPM_WANT_SET_PIDFILE -#define AP_MPM_WANT_SET_MAX_REQUESTS -#define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK -#define AP_MPM_WANT_SET_MAX_MEM_FREE - -#endif /* APACHE_MPM_MPMT_OS2_H */ -/** @} */ diff --git a/server/mpm/mpmt_os2/mpmt_os2.c b/server/mpm/mpmt_os2/mpmt_os2.c index 32b8e1e79d..1b410e721d 100644 --- a/server/mpm/mpmt_os2/mpmt_os2.c +++ b/server/mpm/mpmt_os2/mpmt_os2.c @@ -48,11 +48,11 @@ #include "http_config.h" #include "http_core.h" /* for get_remote_host */ #include "http_connection.h" -#include "mpm.h" #include "ap_mpm.h" #include "ap_listen.h" #include "apr_portable.h" #include "mpm_common.h" +#include "scoreboard.h" #include "apr_strings.h" #include #include @@ -110,7 +110,7 @@ void ap_mpm_child_main(apr_pool_t *pconf); static void set_signals(); -int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s ) +static int mpmt_os2_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s ) { char *listener_shm_name; parent_info_t *parent_info; @@ -414,35 +414,68 @@ static void set_signals() /* Enquiry functions used get MPM status info */ -AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result) +static apr_status_t mpmt_os2_query(int query_code, int *result, apr_status_t *rv) { + *rv = APR_SUCCESS; + switch (query_code) { case AP_MPMQ_MAX_DAEMON_USED: *result = ap_max_daemons_limit; - return APR_SUCCESS; + break; + case AP_MPMQ_IS_THREADED: *result = AP_MPMQ_DYNAMIC; - return APR_SUCCESS; + break; + case AP_MPMQ_IS_FORKED: *result = AP_MPMQ_NOT_SUPPORTED; - return APR_SUCCESS; + break; + case AP_MPMQ_HARD_LIMIT_DAEMONS: *result = HARD_SERVER_LIMIT; - return APR_SUCCESS; + break; + case AP_MPMQ_HARD_LIMIT_THREADS: *result = HARD_THREAD_LIMIT; - return APR_SUCCESS; + break; + case AP_MPMQ_MIN_SPARE_DAEMONS: *result = 0; - return APR_SUCCESS; + break; + case AP_MPMQ_MAX_SPARE_DAEMONS: *result = 0; - return APR_SUCCESS; + break; + case AP_MPMQ_MAX_REQUESTS_DAEMON: *result = ap_max_requests_per_child; - return APR_SUCCESS; + break; + + case AP_MPMQ_GENERATION: + *result = ap_my_generation; + break; + + default: + *rv = APR_ENOTIMPL; + break; } - return APR_ENOTIMPL; + + return OK; +} + + + +static const char *mpmt_os2_note_child_killed(int childnum) +{ + ap_scoreboard_image->parent[childnum].pid = 0; + return APR_SUCCESS; +} + + + +static const char *mpmt_os2_get_name(void) +{ + return "mpmt_os2"; } @@ -466,6 +499,7 @@ static int mpmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t * #ifdef AP_MPM_WANT_SET_MAX_MEM_FREE ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED; #endif + ap_sys_privileges_handlers(1); return OK; } @@ -522,6 +556,10 @@ static void mpmt_os2_hooks(apr_pool_t *p) { ap_hook_pre_config(mpmt_os2_pre_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_check_config(mpmt_os2_check_config, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_mpm(mpmt_os2_run, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_mpm_query(mpmt_os2_query, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_mpm_get_name(mpmt_os2_get_name, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_mpm_note_child_killed(mpmt_os2_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE); } diff --git a/server/mpm/mpmt_os2/mpmt_os2_child.c b/server/mpm/mpmt_os2/mpmt_os2_child.c index 51c85644ce..9acdad5c9e 100644 --- a/server/mpm/mpmt_os2/mpmt_os2_child.c +++ b/server/mpm/mpmt_os2/mpmt_os2_child.c @@ -26,7 +26,7 @@ #include "http_config.h" #include "http_core.h" /* for get_remote_host */ #include "http_connection.h" -#include "mpm.h" +#include "scoreboard.h" #include "ap_mpm.h" #include "ap_listen.h" #include "apr_portable.h"