]> granicus.if.org Git - apache/commitdiff
Brind OS/2 MPM up to date with current API.
authorBrian Havard <bjh@apache.org>
Tue, 3 Nov 2009 13:29:31 +0000 (13:29 +0000)
committerBrian Havard <bjh@apache.org>
Tue, 3 Nov 2009 13:29:31 +0000 (13:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832409 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/config.m4
server/mpm/mpmt_os2/mpm.h [deleted file]
server/mpm/mpmt_os2/mpmt_os2.c
server/mpm/mpmt_os2/mpmt_os2_child.c

index 963bb18e7a1d80311d505b3d634ddd40b84a2d82..b855368492c727b18d7c9bd998ad5b52d86b3d7c 100644 (file)
@@ -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 (file)
index f8bbc30..0000000
+++ /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 */
-/** @} */
index 32b8e1e79d8b3e79afce17ec491da79e8b8731f4..1b410e721d55993e3223a1ae60e2341027b7e60e 100644 (file)
 #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>
@@ -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);
 }
 
 
index 51c85644cea460b39c09e9a8d30f90a0256dd2e4..9acdad5c9e8b45e6f773d66c903d32443419ea42 100644 (file)
@@ -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"