+++ /dev/null
-/* 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 */
-/** @} */
#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 <os2.h>
#include <process.h>
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;
/* 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";
}
#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;
}
{
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);
}