You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bj...@apache.org on 2009/11/03 14:29:31 UTC

svn commit: r832409 - in /httpd/httpd/trunk/server/mpm: config.m4 mpmt_os2/config.m4 mpmt_os2/mpm.h mpmt_os2/mpmt_os2.c mpmt_os2/mpmt_os2_child.c

Author: bjh
Date: Tue Nov  3 13:29:31 2009
New Revision: 832409

URL: http://svn.apache.org/viewvc?rev=832409&view=rev
Log:
Brind OS/2 MPM up to date with current API.

Removed:
    httpd/httpd/trunk/server/mpm/mpmt_os2/mpm.h
Modified:
    httpd/httpd/trunk/server/mpm/config.m4
    httpd/httpd/trunk/server/mpm/mpmt_os2/config.m4   (props changed)
    httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c
    httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c

Modified: httpd/httpd/trunk/server/mpm/config.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/config.m4?rev=832409&r1=832408&r2=832409&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/config.m4 (original)
+++ httpd/httpd/trunk/server/mpm/config.m4 Tue Nov  3 13:29:31 2009
@@ -31,7 +31,7 @@
 
 dnl See if this is a forking platform w.r.t. MPMs
 case $host in
-    *mingw32*)
+    *mingw32* | *os2-emx*)
         forking_mpms_supported=no
         ;;
     *)

Propchange: httpd/httpd/trunk/server/mpm/mpmt_os2/config.m4
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c?rev=832409&r1=832408&r2=832409&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c (original)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c Tue Nov  3 13:29:31 2009
@@ -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 <os2.h>
 #include <process.h>
@@ -110,7 +110,7 @@
 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 @@
 
 /* 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 @@
 #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 @@
 {
     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);
 }
 
 

Modified: httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c?rev=832409&r1=832408&r2=832409&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c (original)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2_child.c Tue Nov  3 13:29:31 2009
@@ -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"