]> granicus.if.org Git - apache/commitdiff
follow up r791309 with additional changes to accommodate the new MPM interfaces
authorJeff Trawick <trawick@apache.org>
Mon, 2 Nov 2009 16:32:05 +0000 (16:32 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 2 Nov 2009 16:32:05 +0000 (16:32 +0000)
(some old API variables are now private, support retrieval of the MPM generation,
implement the mpm_note_child_killed hook)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@831951 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/netware/mpm.h [deleted file]
server/mpm/netware/mpm_netware.c

diff --git a/server/mpm/netware/mpm.h b/server/mpm/netware/mpm.h
deleted file mode 100644 (file)
index 106d62a..0000000
+++ /dev/null
@@ -1,58 +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  netware/mpm.h
- * @brief Netware MPM
- *
- * @defgroup APACHE_MPM_NETWARE Netware MPM
- * @ingroup  APACHE_OS_NETWARE APACHE_MPM
- * @{
- */
-
-#include "scoreboard.h"
-
-#ifndef APACHE_MPM_THREADED_H
-#define APACHE_MPM_THREADED_H
-
-#define THREADED_MPM
-
-#define MPM_NAME "NetWare_Threaded"
-
-/*#define AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
-  #define AP_MPM_WANT_WAIT_OR_TIMEOUT
-  #define AP_MPM_WANT_PROCESS_CHILD_STATUS
-  #define AP_MPM_WANT_SET_PIDFILE
-  #define AP_MPM_WANT_SET_SCOREBOARD
-  #define AP_MPM_WANT_SET_LOCKFILE 
-*/
-#define AP_MPM_WANT_SET_MAX_REQUESTS
-#define AP_MPM_WANT_SET_MAX_MEM_FREE
-#define AP_MPM_WANT_SET_STACKSIZE
-#define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
-/*#define AP_MPM_WANT_SET_COREDUMPDIR
-  #define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH 
-*/
-
-#define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
-
-extern int ap_threads_per_child;
-extern int ap_max_workers_limit;
-extern server_rec *ap_server_conf;
-
-#endif /* APACHE_MPM_THREADED_H */
-/** @} */
index b969cc3cd0ff62a7f44102925a4f195a3830e9ea..4f70d51ef4cc26fba9f69efa1e7f5b5913cca162 100644 (file)
 
 /* config globals */
 
-int ap_threads_per_child=0;         /* Worker threads per child */
+server_rec *ap_server_conf;
+
+/* *Non*-shared http_main globals... */
+
+static int ap_threads_per_child=0;         /* Worker threads per child */
 static int ap_threads_to_start=0;
 static int ap_threads_min_free=0;
 static int ap_threads_max_free=0;
@@ -122,10 +126,7 @@ static int mpm_state = AP_MPMQ_STARTING;
  * to deal with MaxClients changes across SIGWINCH restarts.  We use this
  * value to optimize routines that have to scan the entire scoreboard.
  */
-int ap_max_workers_limit = -1;
-server_rec *ap_server_conf;
-
-/* *Non*-shared http_main globals... */
+static int ap_max_workers_limit = -1;
 
 int hold_screen_on_exit = 0; /* Indicates whether the screen should be held open */
 
@@ -171,7 +172,7 @@ static int volatile shutdown_pending;
 static int volatile restart_pending;
 static int volatile is_graceful;
 static int volatile wait_to_finish=1;
-ap_generation_t volatile ap_my_generation=0;
+static ap_generation_t volatile ap_my_generation=0;
 
 /* a clean exit from a child with proper cleanup */
 static void clean_child_exit(int code, int worker_num, apr_pool_t *ptrans,
@@ -242,6 +243,9 @@ static int netware_query(int query_code, int *result, apr_status_t *rv)
         case AP_MPMQ_MPM_STATE:
             *result = mpm_state;
             break;
+        case AP_MPMQ_GENERATION:
+            *result = ap_my_generation;
+            break;
         default:
             *rv = APR_ENOTIMPL;
             break;
@@ -249,6 +253,12 @@ static int netware_query(int query_code, int *result, apr_status_t *rv)
     return OK;
 }
 
+static apr_status_t netware_note_child_killed(int childnum)
+{
+    ap_scoreboard_image->parent[childnum].pid = 0;
+    return APR_SUCCESS;
+}
+
 static const char *netware_get_name(void)
 {
     return "NetWare";
@@ -1099,6 +1109,7 @@ static void netware_mpm_hooks(apr_pool_t *p)
     //ap_hook_open_logs(netware_open_logs, NULL, aszSucc, APR_HOOK_REALLY_FIRST);
     ap_hook_mpm(netware_run, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_query(netware_query, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_mpm_note_child_killed(netware_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_get_name(netware_get_name, NULL, NULL, APR_HOOK_MIDDLE);
 }