/[apache]/trunk/dist/2.0/patches/22_all_itk_20070425-00.patch
Gentoo

Contents of /trunk/dist/2.0/patches/22_all_itk_20070425-00.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 144 - (show annotations) (download)
Sun Jun 3 11:31:55 2007 UTC (11 years ago) by phreak
File size: 57506 byte(s)
Updated itk patch, aligning to a untouched (as in no other experimental MPM) httpd-2.0.59.
1 unchanged:
2 ---
3 server/mpm/config.m4 | 9
4 server/mpm/experimental/itk/Makefile.in | 5
5 server/mpm/experimental/itk/config.m4 | 3
6 server/mpm/experimental/itk/itk.c | 1560 ++++++++++++++++++++++++++++++
7 server/mpm/experimental/itk/mpm.h | 54 +
8 server/mpm/experimental/itk/mpm_default.h | 68 +
9 6 files changed, 1697 insertions(+), 2 deletions(-)
10
11 --- a/server/mpm/config.m4
12 +++ b/server/mpm/config.m4
13 @@ -1,7 +1,7 @@
14 AC_MSG_CHECKING(which MPM to use)
15 AC_ARG_WITH(mpm,
16 APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use.
17 - MPM={beos|worker|prefork|mpmt_os2|perchild|leader|threadpool}),[
18 + MPM={beos|worker|prefork|mpmt_os2|perchild|leader|threadpool|itk}),[
19 APACHE_MPM=$withval
20 ],[
21 if test "x$APACHE_MPM" = "x"; then
22 @@ -26,12 +26,17 @@ fi
23 APACHE_FAST_OUTPUT(server/mpm/Makefile)
24
25 MPM_NAME=$apache_cv_mpm
26 -if test "$MPM_NAME" = "leader" -o "$MPM_NAME" = "threadpool" -o "$MPM_NAME" = "perchild"; then
27 +if test "$MPM_NAME" = "leader" -o "$MPM_NAME" = "threadpool" -o "$MPM_NAME" = "perchild" -o "$MPM_NAME" = "itk"; then
28 AC_MSG_WARN(You have selected an EXPERIMENTAL MPM. Be warned!)
29 MPM_SUBDIR_NAME=experimental/$MPM_NAME
30 else
31 MPM_SUBDIR_NAME=$MPM_NAME
32 fi
33 +
34 +if "$apache_cv_mpm" = "itk" ; then
35 + AC_CHECK_LIB(cap, cap_init)
36 +fi
37 +
38 MPM_DIR=server/mpm/$MPM_SUBDIR_NAME
39 MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
40
41 --- /dev/null
42 +++ b/server/mpm/experimental/itk/Makefile.in
43 @@ -0,0 +1,5 @@
44 +
45 +LTLIBRARY_NAME = libitk.la
46 +LTLIBRARY_SOURCES = itk.c
47 +
48 +include $(top_srcdir)/build/ltlib.mk
49 --- /dev/null
50 +++ b/server/mpm/experimental/itk/config.m4
51 @@ -0,0 +1,3 @@
52 +if test "$MPM_NAME" = "itk" ; then
53 + APACHE_FAST_OUTPUT(server/mpm/$MPM_SUBDIR_NAME/Makefile)
54 +fi
55 --- /dev/null
56 +++ b/server/mpm/experimental/itk/itk.c
57 @@ -0,0 +1,1560 @@
58 +/* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
59 + * applicable.
60 + *
61 + * Licensed under the Apache License, Version 2.0 (the "License");
62 + * you may not use this file except in compliance with the License.
63 + * You may obtain a copy of the License at
64 + *
65 + * http://www.apache.org/licenses/LICENSE-2.0
66 + *
67 + * Unless required by applicable law or agreed to in writing, software
68 + * distributed under the License is distributed on an "AS IS" BASIS,
69 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70 + * See the License for the specific language governing permissions and
71 + * limitations under the License.
72 + *
73 + * Portions copyright 2005-2007 Steinar H. Gunderson <sgunderson@bigfoot.com>.
74 + * Licensed under the same terms as the rest of Apache.
75 + */
76 +
77 +#include "apr.h"
78 +#include "apr_portable.h"
79 +#include "apr_strings.h"
80 +#include "apr_thread_proc.h"
81 +#include "apr_signal.h"
82 +
83 +# define _DBG(text,par...) \
84 + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, \
85 + "(itkmpm: pid=%d uid=%d) %s(): " text, \
86 + getpid(), getuid(), __FUNCTION__, par)
87 +
88 +#define APR_WANT_STDIO
89 +#define APR_WANT_STRFUNC
90 +#include "apr_want.h"
91 +
92 +#if APR_HAVE_UNISTD_H
93 +#include <unistd.h>
94 +#endif
95 +#if APR_HAVE_SYS_TYPES_H
96 +#include <sys/types.h>
97 +#endif
98 +
99 +#define CORE_PRIVATE
100 +
101 +#include "ap_config.h"
102 +#include "httpd.h"
103 +#include "mpm_default.h"
104 +#include "http_main.h"
105 +#include "http_log.h"
106 +#include "http_config.h"
107 +#include "http_core.h" /* for get_remote_host */
108 +#include "http_connection.h"
109 +#include "http_protocol.h" /* for ap_hook_post_read_request */
110 +#include "scoreboard.h"
111 +#include "ap_mpm.h"
112 +#include "unixd.h"
113 +#include "mpm_common.h"
114 +#include "ap_listen.h"
115 +#include "ap_mmn.h"
116 +#include "apr_poll.h"
117 +
118 +#ifdef HAVE_BSTRING_H
119 +#include <bstring.h> /* for IRIX, FD_SET calls bzero() */
120 +#endif
121 +#ifdef HAVE_TIME_H
122 +#include <time.h>
123 +#endif
124 +#ifdef HAVE_SYS_PROCESSOR_H
125 +#include <sys/processor.h> /* for bindprocessor() */
126 +#endif
127 +
128 +#if HAVE_LIBCAP
129 +#include <sys/capability.h>
130 +#endif
131 +
132 +#include <signal.h>
133 +#include <sys/times.h>
134 +
135 +/* Limit on the total --- clients will be locked out if more servers than
136 + * this are needed. It is intended solely to keep the server from crashing
137 + * when things get out of hand.
138 + *
139 + * We keep a hard maximum number of servers, for two reasons --- first off,
140 + * in case something goes seriously wrong, we want to stop the fork bomb
141 + * short of actually crashing the machine we're running on by filling some
142 + * kernel table. Secondly, it keeps the size of the scoreboard file small
143 + * enough that we can read the whole thing without worrying too much about
144 + * the overhead.
145 + */
146 +#ifndef DEFAULT_SERVER_LIMIT
147 +#define DEFAULT_SERVER_LIMIT 256
148 +#endif
149 +
150 +/* Admin can't tune ServerLimit beyond MAX_SERVER_LIMIT. We want
151 + * some sort of compile-time limit to help catch typos.
152 + */
153 +#ifndef MAX_SERVER_LIMIT
154 +#define MAX_SERVER_LIMIT 20000
155 +#endif
156 +
157 +#ifndef HARD_THREAD_LIMIT
158 +#define HARD_THREAD_LIMIT 1
159 +#endif
160 +
161 +/* config globals */
162 +
163 +int ap_threads_per_child=0; /* Worker threads per child */
164 +static apr_proc_mutex_t *accept_mutex;
165 +static int ap_daemons_to_start=0;
166 +static int ap_daemons_min_free=0;
167 +static int ap_daemons_max_free=0;
168 +static int ap_daemons_limit=0; /* MaxClients */
169 +static int server_limit = DEFAULT_SERVER_LIMIT;
170 +static int first_server_limit;
171 +static int changed_limit_at_restart;
172 +static int mpm_state = AP_MPMQ_STARTING;
173 +static ap_pod_t *pod;
174 +
175 +/*
176 + * The max child slot ever assigned, preserved across restarts. Necessary
177 + * to deal with MaxClients changes across AP_SIG_GRACEFUL restarts. We
178 + * use this value to optimize routines that have to scan the entire scoreboard.
179 + */
180 +int ap_max_daemons_limit = -1;
181 +server_rec *ap_server_conf;
182 +
183 +/* one_process --- debugging mode variable; can be set from the command line
184 + * with the -X flag. If set, this gets you the child_main loop running
185 + * in the process which originally started up (no detach, no make_child),
186 + * which is a pretty nice debugging environment. (You'll get a SIGHUP
187 + * early in standalone_main; just continue through. This is the server
188 + * trying to kill off any child processes which it might have lying
189 + * around --- Apache doesn't keep track of their pids, it just sends
190 + * SIGHUP to the process group, ignoring it in the root process.
191 + * Continue through and you'll be fine.).
192 + */
193 +
194 +static int one_process = 0;
195 +
196 +static apr_pool_t *pconf; /* Pool for config stuff */
197 +static apr_pool_t *pchild; /* Pool for httpd child stuff */
198 +
199 +static pid_t ap_my_pid; /* it seems silly to call getpid all the time */
200 +static pid_t parent_pid;
201 +#ifndef MULTITHREAD
202 +static int my_child_num;
203 +#endif
204 +ap_generation_t volatile ap_my_generation=0;
205 +
206 +#ifdef TPF
207 +int tpf_child = 0;
208 +char tpf_server_name[INETD_SERVNAME_LENGTH+1];
209 +#endif /* TPF */
210 +
211 +static int die_now = 0;
212 +
213 +typedef struct
214 +{
215 + uid_t uid;
216 + gid_t gid;
217 + char *username;
218 + int max_clients_vhost;
219 + int nice_value;
220 +} itk_server_conf;
221 +
222 +module AP_MODULE_DECLARE_DATA mpm_itk_module;
223 +
224 +#ifdef GPROF
225 +/*
226 + * change directory for gprof to plop the gmon.out file
227 + * configure in httpd.conf:
228 + * GprofDir $RuntimeDir/ -> $ServerRoot/$RuntimeDir/gmon.out
229 + * GprofDir $RuntimeDir/% -> $ServerRoot/$RuntimeDir/gprof.$pid/gmon.out
230 + */
231 +static void chdir_for_gprof(void)
232 +{
233 + core_server_config *sconf =
234 + ap_get_module_config(ap_server_conf->module_config, &core_module);
235 + char *dir = sconf->gprof_dir;
236 + const char *use_dir;
237 +
238 + if(dir) {
239 + apr_status_t res;
240 + char buf[512];
241 + int len = strlen(sconf->gprof_dir) - 1;
242 + if(*(dir + len) == '%') {
243 + dir[len] = '\0';
244 + apr_snprintf(buf, sizeof(buf), "%sgprof.%d", dir, (int)getpid());
245 + }
246 + use_dir = ap_server_root_relative(pconf, buf[0] ? buf : dir);
247 + res = apr_dir_make(use_dir, 0755, pconf);
248 + if(res != APR_SUCCESS && !APR_STATUS_IS_EEXIST(res)) {
249 + ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
250 + "gprof: error creating directory %s", dir);
251 + }
252 + }
253 + else {
254 + use_dir = ap_server_root_relative(pconf, DEFAULT_REL_RUNTIMEDIR);
255 + }
256 +
257 + chdir(use_dir);
258 +}
259 +#else
260 +#define chdir_for_gprof()
261 +#endif
262 +
263 +/* XXX - I don't know if TPF will ever use this module or not, so leave
264 + * the ap_check_signals calls in but disable them - manoj */
265 +#define ap_check_signals()
266 +
267 +/* a clean exit from a child with proper cleanup */
268 +static void clean_child_exit(int code) __attribute__ ((noreturn));
269 +static void clean_child_exit(int code)
270 +{
271 + mpm_state = AP_MPMQ_STOPPING;
272 +
273 + if (pchild) {
274 + apr_pool_destroy(pchild);
275 + }
276 + ap_mpm_pod_close(pod);
277 + chdir_for_gprof();
278 + exit(code);
279 +}
280 +
281 +static void accept_mutex_on(void)
282 +{
283 + apr_status_t rv = apr_proc_mutex_lock(accept_mutex);
284 + if (rv != APR_SUCCESS) {
285 + const char *msg = "couldn't grab the accept mutex";
286 +
287 + if (ap_my_generation !=
288 + ap_scoreboard_image->global->running_generation) {
289 + ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL, msg);
290 + clean_child_exit(0);
291 + }
292 + else {
293 + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, msg);
294 + exit(APEXIT_CHILDFATAL);
295 + }
296 + }
297 +}
298 +
299 +static void accept_mutex_off(void)
300 +{
301 + apr_status_t rv = apr_proc_mutex_unlock(accept_mutex);
302 + if (rv != APR_SUCCESS) {
303 + const char *msg = "couldn't release the accept mutex";
304 +
305 + if (ap_my_generation !=
306 + ap_scoreboard_image->global->running_generation) {
307 + ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL, msg);
308 + /* don't exit here... we have a connection to
309 + * process, after which point we'll see that the
310 + * generation changed and we'll exit cleanly
311 + */
312 + }
313 + else {
314 + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, NULL, msg);
315 + exit(APEXIT_CHILDFATAL);
316 + }
317 + }
318 +}
319 +
320 +/* On some architectures it's safe to do unserialized accept()s in the single
321 + * Listen case. But it's never safe to do it in the case where there's
322 + * multiple Listen statements. Define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
323 + * when it's safe in the single Listen case.
324 + */
325 +#ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT
326 +#define SAFE_ACCEPT(stmt) do {if (ap_listeners->next) {stmt;}} while(0)
327 +#else
328 +#define SAFE_ACCEPT(stmt) do {stmt;} while(0)
329 +#endif
330 +
331 +AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
332 +{
333 + switch(query_code){
334 + case AP_MPMQ_MAX_DAEMON_USED:
335 + *result = ap_daemons_limit;
336 + return APR_SUCCESS;
337 + case AP_MPMQ_IS_THREADED:
338 + *result = AP_MPMQ_NOT_SUPPORTED;
339 + return APR_SUCCESS;
340 + case AP_MPMQ_IS_FORKED:
341 + *result = AP_MPMQ_DYNAMIC;
342 + return APR_SUCCESS;
343 + case AP_MPMQ_HARD_LIMIT_DAEMONS:
344 + *result = server_limit;
345 + return APR_SUCCESS;
346 + case AP_MPMQ_HARD_LIMIT_THREADS:
347 + *result = HARD_THREAD_LIMIT;
348 + return APR_SUCCESS;
349 + case AP_MPMQ_MAX_THREADS:
350 + *result = 0;
351 + return APR_SUCCESS;
352 + case AP_MPMQ_MIN_SPARE_DAEMONS:
353 + *result = ap_daemons_min_free;
354 + return APR_SUCCESS;
355 + case AP_MPMQ_MIN_SPARE_THREADS:
356 + *result = 0;
357 + return APR_SUCCESS;
358 + case AP_MPMQ_MAX_SPARE_DAEMONS:
359 + *result = ap_daemons_max_free;
360 + return APR_SUCCESS;
361 + case AP_MPMQ_MAX_SPARE_THREADS:
362 + *result = 0;
363 + return APR_SUCCESS;
364 + case AP_MPMQ_MAX_REQUESTS_DAEMON:
365 + *result = ap_max_requests_per_child;
366 + return APR_SUCCESS;
367 + case AP_MPMQ_MAX_DAEMONS:
368 + *result = server_limit;
369 + return APR_SUCCESS;
370 + case AP_MPMQ_MPM_STATE:
371 + *result = mpm_state;
372 + return APR_SUCCESS;
373 + }
374 + return APR_ENOTIMPL;
375 +}
376 +
377 +#if defined(NEED_WAITPID)
378 +/*
379 + Systems without a real waitpid sometimes lose a child's exit while waiting
380 + for another. Search through the scoreboard for missing children.
381 + */
382 +int reap_children(int *exitcode, apr_exit_why_e *status)
383 +{
384 + int n, pid;
385 +
386 + for (n = 0; n < ap_max_daemons_limit; ++n) {
387 + if (ap_scoreboard_image->servers[n][0].status != SERVER_DEAD &&
388 + kill((pid = ap_scoreboard_image->parent[n].pid), 0) == -1) {
389 + ap_update_child_status_from_indexes(n, 0, SERVER_DEAD, NULL);
390 + /* just mark it as having a successful exit status */
391 + *status = APR_PROC_EXIT;
392 + *exitcode = 0;
393 + return(pid);
394 + }
395 + }
396 + return 0;
397 +}
398 +#endif
399 +
400 +/*****************************************************************
401 + * Connection structures and accounting...
402 + */
403 +
404 +static void just_die(int sig)
405 +{
406 + clean_child_exit(0);
407 +}
408 +
409 +/* volatile just in case */
410 +static int volatile shutdown_pending;
411 +static int volatile restart_pending;
412 +static int volatile is_graceful;
413 +
414 +static void sig_term(int sig)
415 +{
416 + if (shutdown_pending == 1) {
417 + /* Um, is this _probably_ not an error, if the user has
418 + * tried to do a shutdown twice quickly, so we won't
419 + * worry about reporting it.
420 + */
421 + return;
422 + }
423 + shutdown_pending = 1;
424 +}
425 +
426 +/* restart() is the signal handler for SIGHUP and AP_SIG_GRACEFUL
427 + * in the parent process, unless running in ONE_PROCESS mode
428 + */
429 +static void restart(int sig)
430 +{
431 + if (restart_pending == 1) {
432 + /* Probably not an error - don't bother reporting it */
433 + return;
434 + }
435 + restart_pending = 1;
436 + is_graceful = (sig == AP_SIG_GRACEFUL);
437 +}
438 +
439 +static void set_signals(void)
440 +{
441 +#ifndef NO_USE_SIGACTION
442 + struct sigaction sa;
443 +#endif
444 +
445 + if (!one_process) {
446 + ap_fatal_signal_setup(ap_server_conf, pconf);
447 + }
448 +
449 +#ifndef NO_USE_SIGACTION
450 + sigemptyset(&sa.sa_mask);
451 + sa.sa_flags = 0;
452 +
453 + sa.sa_handler = sig_term;
454 + if (sigaction(SIGTERM, &sa, NULL) < 0)
455 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGTERM)");
456 +#ifdef SIGINT
457 + if (sigaction(SIGINT, &sa, NULL) < 0)
458 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGINT)");
459 +#endif
460 +#ifdef SIGXCPU
461 + sa.sa_handler = SIG_DFL;
462 + if (sigaction(SIGXCPU, &sa, NULL) < 0)
463 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGXCPU)");
464 +#endif
465 +#ifdef SIGXFSZ
466 + sa.sa_handler = SIG_DFL;
467 + if (sigaction(SIGXFSZ, &sa, NULL) < 0)
468 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGXFSZ)");
469 +#endif
470 +#ifdef SIGPIPE
471 + sa.sa_handler = SIG_IGN;
472 + if (sigaction(SIGPIPE, &sa, NULL) < 0)
473 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
474 +#endif
475 +
476 + /* we want to ignore HUPs and AP_SIG_GRACEFUL while we're busy
477 + * processing one */
478 + sigaddset(&sa.sa_mask, SIGHUP);
479 + sigaddset(&sa.sa_mask, AP_SIG_GRACEFUL);
480 + sa.sa_handler = restart;
481 + if (sigaction(SIGHUP, &sa, NULL) < 0)
482 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
483 + if (sigaction(AP_SIG_GRACEFUL, &sa, NULL) < 0)
484 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(" AP_SIG_GRACEFUL_STRING ")");
485 +#else
486 + if (!one_process) {
487 +#ifdef SIGXCPU
488 + apr_signal(SIGXCPU, SIG_DFL);
489 +#endif /* SIGXCPU */
490 +#ifdef SIGXFSZ
491 + apr_signal(SIGXFSZ, SIG_DFL);
492 +#endif /* SIGXFSZ */
493 + }
494 +
495 + apr_signal(SIGTERM, sig_term);
496 +#ifdef SIGHUP
497 + apr_signal(SIGHUP, restart);
498 +#endif /* SIGHUP */
499 +#ifdef AP_SIG_GRACEFUL
500 + apr_signal(AP_SIG_GRACEFUL, restart);
501 +#endif /* AP_SIG_GRACEFUL */
502 +#ifdef SIGPIPE
503 + apr_signal(SIGPIPE, SIG_IGN);
504 +#endif /* SIGPIPE */
505 +
506 +#endif
507 +}
508 +
509 +/*****************************************************************
510 + * Child process main loop.
511 + * The following vars are static to avoid getting clobbered by longjmp();
512 + * they are really private to child_main.
513 + */
514 +
515 +static int requests_this_child;
516 +static int num_listensocks = 0;
517 +static ap_listen_rec *listensocks;
518 +
519 +int ap_graceful_stop_signalled(void)
520 +{
521 + /* not ever called anymore... */
522 + return 0;
523 +}
524 +
525 +
526 +static void child_main(int child_num_arg)
527 +{
528 + apr_pool_t *ptrans;
529 + apr_allocator_t *allocator;
530 + conn_rec *current_conn;
531 + apr_status_t status = APR_EINIT;
532 + int i;
533 + ap_listen_rec *lr;
534 + int curr_pollfd, last_pollfd = 0;
535 + apr_pollfd_t *pollset;
536 + int offset;
537 + void *csd;
538 + ap_sb_handle_t *sbh;
539 + apr_status_t rv;
540 + apr_bucket_alloc_t *bucket_alloc;
541 +
542 +#if HAVE_LIBCAP
543 + cap_t caps;
544 + cap_value_t suidcaps[] = {
545 + CAP_SETUID,
546 + CAP_SETGID,
547 + CAP_SYS_NICE
548 + };
549 +#endif
550 +
551 + mpm_state = AP_MPMQ_STARTING; /* for benefit of any hooks that run as this
552 + * child initializes
553 + */
554 +
555 + my_child_num = child_num_arg;
556 + ap_my_pid = getpid();
557 + csd = NULL;
558 + requests_this_child = 0;
559 +
560 + ap_fatal_signal_child_setup(ap_server_conf);
561 +
562 + /* Get a sub context for global allocations in this child, so that
563 + * we can have cleanups occur when the child exits.
564 + */
565 + apr_allocator_create(&allocator);
566 + apr_allocator_max_free_set(allocator, ap_max_mem_free);
567 + apr_pool_create_ex(&pchild, pconf, NULL, allocator);
568 + apr_allocator_owner_set(allocator, pchild);
569 +
570 + apr_pool_create(&ptrans, pchild);
571 + apr_pool_tag(ptrans, "transaction");
572 +
573 + /* needs to be done before we switch UIDs so we have permissions */
574 + ap_reopen_scoreboard(pchild, NULL, 0);
575 + rv = apr_proc_mutex_child_init(&accept_mutex, ap_lock_fname, pchild);
576 + if (rv != APR_SUCCESS) {
577 + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, ap_server_conf,
578 + "Couldn't initialize cross-process lock in child");
579 + clean_child_exit(APEXIT_CHILDFATAL);
580 + }
581 +
582 + ap_run_child_init(pchild, ap_server_conf);
583 +
584 + ap_create_sb_handle(&sbh, pchild, my_child_num, 0);
585 +
586 + (void) ap_update_child_status(sbh, SERVER_READY, (request_rec *) NULL);
587 +
588 + /* Set up the pollfd array */
589 + listensocks = apr_pcalloc(pchild,
590 + sizeof(*listensocks) * (num_listensocks));
591 + for (lr = ap_listeners, i = 0; i < num_listensocks; lr = lr->next, i++) {
592 + listensocks[i].accept_func = lr->accept_func;
593 + listensocks[i].sd = lr->sd;
594 + }
595 +
596 + pollset = apr_palloc(pchild, sizeof(*pollset) * num_listensocks);
597 + pollset[0].p = pchild;
598 + for (i = 0; i < num_listensocks; i++) {
599 + pollset[i].desc.s = listensocks[i].sd;
600 + pollset[i].desc_type = APR_POLL_SOCKET;
601 + pollset[i].reqevents = APR_POLLIN;
602 + }
603 +
604 +#if HAVE_LIBCAP
605 + /* Drop as many privileges as we can. We'll still
606 + * access files with uid=0, and we can setuid() to anything, but
607 + * at least there's tons of other evilness (like loading kernel
608 + * modules) we can't do directly. (The setuid() capability will
609 + * go away automatically when we setuid() or exec() -- the former
610 + * is likely to come first.)
611 + */
612 + caps = cap_init();
613 + cap_clear(caps);
614 + cap_set_flag(caps, CAP_PERMITTED, sizeof(suidcaps)/sizeof(cap_value_t), suidcaps, CAP_SET);
615 + cap_set_flag(caps, CAP_EFFECTIVE, sizeof(suidcaps)/sizeof(cap_value_t), suidcaps, CAP_SET);
616 + cap_set_proc(caps);
617 + cap_free(caps);
618 +#endif
619 +
620 + mpm_state = AP_MPMQ_RUNNING;
621 +
622 + bucket_alloc = apr_bucket_alloc_create(pchild);
623 +
624 + while (!die_now) {
625 + /*
626 + * (Re)initialize this child to a pre-connection state.
627 + */
628 +
629 + current_conn = NULL;
630 +
631 + apr_pool_clear(ptrans);
632 +
633 + if ((ap_max_requests_per_child > 0
634 + && requests_this_child++ >= ap_max_requests_per_child)) {
635 + clean_child_exit(0);
636 + }
637 +
638 + (void) ap_update_child_status(sbh, SERVER_READY, (request_rec *) NULL);
639 +
640 + /*
641 + * Wait for an acceptable connection to arrive.
642 + */
643 +
644 + /* Lock around "accept", if necessary */
645 + SAFE_ACCEPT(accept_mutex_on());
646 +
647 + if (num_listensocks == 1) {
648 + offset = 0;
649 + }
650 + else {
651 + /* multiple listening sockets - need to poll */
652 + for (;;) {
653 + apr_status_t ret;
654 + apr_int32_t n;
655 +
656 + ret = apr_poll(pollset, num_listensocks, &n, -1);
657 + if (ret != APR_SUCCESS) {
658 + if (APR_STATUS_IS_EINTR(ret)) {
659 + continue;
660 + }
661 + /* Single Unix documents select as returning errnos
662 + * EBADF, EINTR, and EINVAL... and in none of those
663 + * cases does it make sense to continue. In fact
664 + * on Linux 2.0.x we seem to end up with EFAULT
665 + * occasionally, and we'd loop forever due to it.
666 + */
667 + ap_log_error(APLOG_MARK, APLOG_ERR, ret, ap_server_conf,
668 + "apr_poll: (listen)");
669 + clean_child_exit(1);
670 + }
671 + /* find a listener */
672 + curr_pollfd = last_pollfd;
673 + do {
674 + curr_pollfd++;
675 + if (curr_pollfd >= num_listensocks) {
676 + curr_pollfd = 0;
677 + }
678 + /* XXX: Should we check for POLLERR? */
679 + if (pollset[curr_pollfd].rtnevents & APR_POLLIN) {
680 + last_pollfd = curr_pollfd;
681 + offset = curr_pollfd;
682 + goto got_fd;
683 + }
684 + } while (curr_pollfd != last_pollfd);
685 +
686 + continue;
687 + }
688 + }
689 + got_fd:
690 + /* if we accept() something we don't want to die, so we have to
691 + * defer the exit
692 + */
693 + status = listensocks[offset].accept_func(&csd,
694 + &listensocks[offset], ptrans);
695 + SAFE_ACCEPT(accept_mutex_off()); /* unlock after "accept" */
696 +
697 + if (status == APR_EGENERAL) {
698 + /* resource shortage or should-not-occur occured */
699 + clean_child_exit(1);
700 + }
701 + else if (status != APR_SUCCESS) {
702 + continue;
703 + }
704 +
705 + /*
706 + * We now have a connection, so set it up with the appropriate
707 + * socket options, file descriptors, and read/write buffers.
708 + */
709 +
710 + {
711 + pid_t pid = fork();
712 + int status;
713 + switch (pid) {
714 + case -1:
715 + ap_log_error(APLOG_MARK, APLOG_ERR, errno, NULL, "fork: Unable to fork new process");
716 + break;
717 + case 0: /* child */
718 + apr_proc_mutex_child_init(&accept_mutex, ap_lock_fname, pchild);
719 + current_conn = ap_run_create_connection(ptrans, ap_server_conf, csd, my_child_num, sbh, bucket_alloc);
720 + if (current_conn) {
721 + ap_process_connection(current_conn, csd);
722 + ap_lingering_close(current_conn);
723 + }
724 + exit(0);
725 + default: /* parent; just wait for child to be done */
726 + if (waitpid(pid, &status, 0) != pid || !WIFEXITED(status)) {
727 + if (WIFSIGNALED(status)) {
728 + ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, "child died with signal %u", WTERMSIG(status));
729 + } else if (WEXITSTATUS(status) != 0) {
730 + ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf, "child exited with non-zero exit status %u", WEXITSTATUS(status));
731 + } else {
732 + ap_log_error(APLOG_MARK, APLOG_ERR, errno, NULL, "waitpid() failed");
733 + }
734 + clean_child_exit(1);
735 + }
736 + break;
737 + }
738 + }
739 +
740 + /* Check the pod and the generation number after processing a
741 + * connection so that we'll go away if a graceful restart occurred
742 + * while we were processing the connection or we are the lucky
743 + * idle server process that gets to die.
744 + */
745 + if (ap_mpm_pod_check(pod) == APR_SUCCESS) { /* selected as idle? */
746 + die_now = 1;
747 + }
748 + else if (ap_my_generation !=
749 + ap_scoreboard_image->global->running_generation) { /* restart? */
750 + /* yeah, this could be non-graceful restart, in which case the
751 + * parent will kill us soon enough, but why bother checking?
752 + */
753 + die_now = 1;
754 + }
755 +
756 + /* if we have already setuid(), die (we can't be used anyhow) */
757 + if (getuid())
758 + die_now = 1;
759 + }
760 + clean_child_exit(0);
761 +}
762 +
763 +
764 +static int make_child(server_rec *s, int slot)
765 +{
766 + int pid;
767 +
768 + if (slot + 1 > ap_max_daemons_limit) {
769 + ap_max_daemons_limit = slot + 1;
770 + }
771 +
772 + if (one_process) {
773 + apr_signal(SIGHUP, just_die);
774 + /* Don't catch AP_SIG_GRACEFUL in ONE_PROCESS mode :) */
775 + apr_signal(SIGINT, just_die);
776 +#ifdef SIGQUIT
777 + apr_signal(SIGQUIT, SIG_DFL);
778 +#endif
779 + apr_signal(SIGTERM, just_die);
780 + child_main(slot);
781 + }
782 +
783 + (void) ap_update_child_status_from_indexes(slot, 0, SERVER_STARTING,
784 + (request_rec *) NULL);
785 +
786 +
787 +#ifdef _OSD_POSIX
788 + /* BS2000 requires a "special" version of fork() before a setuid() call */
789 + if ((pid = os_fork(unixd_config.user_name)) == -1) {
790 +#elif defined(TPF)
791 + if ((pid = os_fork(s, slot)) == -1) {
792 +#else
793 + if ((pid = fork()) == -1) {
794 +#endif
795 + ap_log_error(APLOG_MARK, APLOG_ERR, errno, s, "fork: Unable to fork new process");
796 +
797 + /* fork didn't succeed. Fix the scoreboard or else
798 + * it will say SERVER_STARTING forever and ever
799 + */
800 + (void) ap_update_child_status_from_indexes(slot, 0, SERVER_DEAD,
801 + (request_rec *) NULL);
802 +
803 + /* In case system resources are maxxed out, we don't want
804 + Apache running away with the CPU trying to fork over and
805 + over and over again. */
806 + sleep(10);
807 +
808 + return -1;
809 + }
810 +
811 + if (!pid) {
812 +#ifdef HAVE_BINDPROCESSOR
813 + /* by default AIX binds to a single processor
814 + * this bit unbinds children which will then bind to another cpu
815 + */
816 + int status = bindprocessor(BINDPROCESS, (int)getpid(),
817 + PROCESSOR_CLASS_ANY);
818 + if (status != OK) {
819 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno,
820 + ap_server_conf, "processor unbind failed %d", status);
821 + }
822 +#endif
823 + RAISE_SIGSTOP(MAKE_CHILD);
824 + AP_MONCONTROL(1);
825 + /* Disable the parent's signal handlers and set up proper handling in
826 + * the child.
827 + */
828 + apr_signal(SIGHUP, just_die);
829 + apr_signal(SIGTERM, just_die);
830 + /* The child process doesn't do anything for AP_SIG_GRACEFUL.
831 + * Instead, the pod is used for signalling graceful restart.
832 + */
833 + apr_signal(AP_SIG_GRACEFUL, SIG_IGN);
834 + child_main(slot);
835 + }
836 +
837 + ap_scoreboard_image->parent[slot].pid = pid;
838 +
839 + return 0;
840 +}
841 +
842 +
843 +/* start up a bunch of children */
844 +static void startup_children(int number_to_start)
845 +{
846 + int i;
847 +
848 + for (i = 0; number_to_start && i < ap_daemons_limit; ++i) {
849 + if (ap_scoreboard_image->servers[i][0].status != SERVER_DEAD) {
850 + continue;
851 + }
852 + if (make_child(ap_server_conf, i) < 0) {
853 + break;
854 + }
855 + --number_to_start;
856 + }
857 +}
858 +
859 +
860 +/*
861 + * idle_spawn_rate is the number of children that will be spawned on the
862 + * next maintenance cycle if there aren't enough idle servers. It is
863 + * doubled up to MAX_SPAWN_RATE, and reset only when a cycle goes by
864 + * without the need to spawn.
865 + */
866 +static int idle_spawn_rate = 1;
867 +#ifndef MAX_SPAWN_RATE
868 +#define MAX_SPAWN_RATE (32)
869 +#endif
870 +static int hold_off_on_exponential_spawning;
871 +
872 +static void perform_idle_server_maintenance(apr_pool_t *p)
873 +{
874 + int i;
875 + int to_kill;
876 + int idle_count;
877 + worker_score *ws;
878 + int free_length;
879 + int free_slots[MAX_SPAWN_RATE];
880 + int last_non_dead;
881 + int total_non_dead;
882 +
883 + /* initialize the free_list */
884 + free_length = 0;
885 +
886 + to_kill = -1;
887 + idle_count = 0;
888 + last_non_dead = -1;
889 + total_non_dead = 0;
890 +
891 + for (i = 0; i < ap_daemons_limit; ++i) {
892 + int status;
893 +
894 + if (i >= ap_max_daemons_limit && free_length == idle_spawn_rate)
895 + break;
896 + ws = &ap_scoreboard_image->servers[i][0];
897 + status = ws->status;
898 + if (status == SERVER_DEAD) {
899 + /* try to keep children numbers as low as possible */
900 + if (free_length < idle_spawn_rate) {
901 + free_slots[free_length] = i;
902 + ++free_length;
903 + }
904 + }
905 + else {
906 + /* We consider a starting server as idle because we started it
907 + * at least a cycle ago, and if it still hasn't finished starting
908 + * then we're just going to swamp things worse by forking more.
909 + * So we hopefully won't need to fork more if we count it.
910 + * This depends on the ordering of SERVER_READY and SERVER_STARTING.
911 + */
912 + if (status <= SERVER_READY) {
913 + ++ idle_count;
914 + /* always kill the highest numbered child if we have to...
915 + * no really well thought out reason ... other than observing
916 + * the server behaviour under linux where lower numbered children
917 + * tend to service more hits (and hence are more likely to have
918 + * their data in cpu caches).
919 + */
920 + to_kill = i;
921 + }
922 +
923 + ++total_non_dead;
924 + last_non_dead = i;
925 + }
926 + }
927 + ap_max_daemons_limit = last_non_dead + 1;
928 + if (idle_count > ap_daemons_max_free) {
929 + /* kill off one child... we use the pod because that'll cause it to
930 + * shut down gracefully, in case it happened to pick up a request
931 + * while we were counting
932 + */
933 + ap_mpm_pod_signal(pod);
934 + idle_spawn_rate = 1;
935 + }
936 + else if (idle_count < ap_daemons_min_free) {
937 + /* terminate the free list */
938 + if (free_length == 0) {
939 + /* only report this condition once */
940 + static int reported = 0;
941 +
942 + if (!reported) {
943 + ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf,
944 + "server reached MaxClients setting, consider"
945 + " raising the MaxClients setting");
946 + reported = 1;
947 + }
948 + idle_spawn_rate = 1;
949 + }
950 + else {
951 + if (idle_spawn_rate >= 8) {
952 + ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
953 + "server seems busy, (you may need "
954 + "to increase StartServers, or Min/MaxSpareServers), "
955 + "spawning %d children, there are %d idle, and "
956 + "%d total children", idle_spawn_rate,
957 + idle_count, total_non_dead);
958 + }
959 + for (i = 0; i < free_length; ++i) {
960 +#ifdef TPF
961 + if (make_child(ap_server_conf, free_slots[i]) == -1) {
962 + if(free_length == 1) {
963 + shutdown_pending = 1;
964 + ap_log_error(APLOG_MARK, APLOG_EMERG, 0, ap_server_conf,
965 + "No active child processes: shutting down");
966 + }
967 + }
968 +#else
969 + make_child(ap_server_conf, free_slots[i]);
970 +#endif /* TPF */
971 + }
972 + /* the next time around we want to spawn twice as many if this
973 + * wasn't good enough, but not if we've just done a graceful
974 + */
975 + if (hold_off_on_exponential_spawning) {
976 + --hold_off_on_exponential_spawning;
977 + }
978 + else if (idle_spawn_rate < MAX_SPAWN_RATE) {
979 + idle_spawn_rate *= 2;
980 + }
981 + }
982 + }
983 + else {
984 + idle_spawn_rate = 1;
985 + }
986 +}
987 +
988 +/*****************************************************************
989 + * Executive routines.
990 + */
991 +
992 +int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
993 +{
994 + int index;
995 + int remaining_children_to_start;
996 + apr_status_t rv;
997 +
998 + ap_log_pid(pconf, ap_pid_fname);
999 +
1000 + first_server_limit = server_limit;
1001 + if (changed_limit_at_restart) {
1002 + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s,
1003 + "WARNING: Attempt to change ServerLimit "
1004 + "ignored during restart");
1005 + changed_limit_at_restart = 0;
1006 + }
1007 +
1008 + /* Initialize cross-process accept lock */
1009 + ap_lock_fname = apr_psprintf(_pconf, "%s.%" APR_PID_T_FMT,
1010 + ap_server_root_relative(_pconf, ap_lock_fname),
1011 + ap_my_pid);
1012 +
1013 + rv = apr_proc_mutex_create(&accept_mutex, ap_lock_fname,
1014 + ap_accept_lock_mech, _pconf);
1015 + if (rv != APR_SUCCESS) {
1016 + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
1017 + "Couldn't create accept lock");
1018 + mpm_state = AP_MPMQ_STOPPING;
1019 + return 1;
1020 + }
1021 +
1022 +#if APR_USE_SYSVSEM_SERIALIZE
1023 + if (ap_accept_lock_mech == APR_LOCK_DEFAULT ||
1024 + ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
1025 +#else
1026 + if (ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
1027 +#endif
1028 + rv = unixd_set_proc_mutex_perms(accept_mutex);
1029 + if (rv != APR_SUCCESS) {
1030 + ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
1031 + "Couldn't set permissions on cross-process lock; "
1032 + "check User and Group directives");
1033 + mpm_state = AP_MPMQ_STOPPING;
1034 + return 1;
1035 + }
1036 + }
1037 +
1038 + if (!is_graceful) {
1039 + if (ap_run_pre_mpm(s->process->pool, SB_SHARED) != OK) {
1040 + mpm_state = AP_MPMQ_STOPPING;
1041 + return 1;
1042 + }
1043 + /* fix the generation number in the global score; we just got a new,
1044 + * cleared scoreboard
1045 + */
1046 + ap_scoreboard_image->global->running_generation = ap_my_generation;
1047 + }
1048 +
1049 + set_signals();
1050 +
1051 + if (one_process) {
1052 + AP_MONCONTROL(1);
1053 + }
1054 +
1055 + if (ap_daemons_max_free < ap_daemons_min_free + 1) /* Don't thrash... */
1056 + ap_daemons_max_free = ap_daemons_min_free + 1;
1057 +
1058 + /* If we're doing a graceful_restart then we're going to see a lot
1059 + * of children exiting immediately when we get into the main loop
1060 + * below (because we just sent them AP_SIG_GRACEFUL). This happens pretty
1061 + * rapidly... and for each one that exits we'll start a new one until
1062 + * we reach at least daemons_min_free. But we may be permitted to
1063 + * start more than that, so we'll just keep track of how many we're
1064 + * supposed to start up without the 1 second penalty between each fork.
1065 + */
1066 + remaining_children_to_start = ap_daemons_to_start;
1067 + if (remaining_children_to_start > ap_daemons_limit) {
1068 + remaining_children_to_start = ap_daemons_limit;
1069 + }
1070 + if (!is_graceful) {
1071 + startup_children(remaining_children_to_start);
1072 + remaining_children_to_start = 0;
1073 + }
1074 + else {
1075 + /* give the system some time to recover before kicking into
1076 + * exponential mode */
1077 + hold_off_on_exponential_spawning = 10;
1078 + }
1079 +
1080 + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
1081 + "%s configured -- resuming normal operations",
1082 + ap_get_server_version());
1083 + ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf,
1084 + "Server built: %s", ap_get_server_built());
1085 +#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
1086 + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
1087 + "AcceptMutex: %s (default: %s)",
1088 + apr_proc_mutex_name(accept_mutex),
1089 + apr_proc_mutex_defname());
1090 +#endif
1091 + restart_pending = shutdown_pending = 0;
1092 +
1093 + mpm_state = AP_MPMQ_RUNNING;
1094 +
1095 + while (!restart_pending && !shutdown_pending) {
1096 + int child_slot;
1097 + apr_exit_why_e exitwhy;
1098 + int status, processed_status;
1099 + /* this is a memory leak, but I'll fix it later. */
1100 + apr_proc_t pid;
1101 +
1102 + ap_wait_or_timeout(&exitwhy, &status, &pid, pconf);
1103 +
1104 + /* XXX: if it takes longer than 1 second for all our children
1105 + * to start up and get into IDLE state then we may spawn an
1106 + * extra child
1107 + */
1108 + if (pid.pid != -1) {
1109 + processed_status = ap_process_child_status(&pid, exitwhy, status);
1110 + if (processed_status == APEXIT_CHILDFATAL) {
1111 + mpm_state = AP_MPMQ_STOPPING;
1112 + return 1;
1113 + }
1114 +
1115 + /* non-fatal death... note that it's gone in the scoreboard. */
1116 + child_slot = find_child_by_pid(&pid);
1117 + if (child_slot >= 0) {
1118 + (void) ap_update_child_status_from_indexes(child_slot, 0, SERVER_DEAD,
1119 + (request_rec *) NULL);
1120 + if (processed_status == APEXIT_CHILDSICK) {
1121 + /* child detected a resource shortage (E[NM]FILE, ENOBUFS, etc)
1122 + * cut the fork rate to the minimum
1123 + */
1124 + idle_spawn_rate = 1;
1125 + }
1126 + else if (remaining_children_to_start
1127 + && child_slot < ap_daemons_limit) {
1128 + /* we're still doing a 1-for-1 replacement of dead
1129 + * children with new children
1130 + */
1131 + make_child(ap_server_conf, child_slot);
1132 + --remaining_children_to_start;
1133 + }
1134 +#if APR_HAS_OTHER_CHILD
1135 + }
1136 + else if (apr_proc_other_child_read(&pid, status) == 0) {
1137 + /* handled */
1138 +#endif
1139 + }
1140 + else if (is_graceful) {
1141 + /* Great, we've probably just lost a slot in the
1142 + * scoreboard. Somehow we don't know about this
1143 + * child.
1144 + */
1145 + ap_log_error(APLOG_MARK, APLOG_WARNING,
1146 + 0, ap_server_conf,
1147 + "long lost child came home! (pid %ld)", (long)pid.pid);
1148 + }
1149 + /* Don't perform idle maintenance when a child dies,
1150 + * only do it when there's a timeout. Remember only a
1151 + * finite number of children can die, and it's pretty
1152 + * pathological for a lot to die suddenly.
1153 + */
1154 + continue;
1155 + }
1156 + else if (remaining_children_to_start) {
1157 + /* we hit a 1 second timeout in which none of the previous
1158 + * generation of children needed to be reaped... so assume
1159 + * they're all done, and pick up the slack if any is left.
1160 + */
1161 + startup_children(remaining_children_to_start);
1162 + remaining_children_to_start = 0;
1163 + /* In any event we really shouldn't do the code below because
1164 + * few of the servers we just started are in the IDLE state
1165 + * yet, so we'd mistakenly create an extra server.
1166 + */
1167 + continue;
1168 + }
1169 +
1170 + perform_idle_server_maintenance(pconf);
1171 +#ifdef TPF
1172 + shutdown_pending = os_check_server(tpf_server_name);
1173 + ap_check_signals();
1174 + sleep(1);
1175 +#endif /*TPF */
1176 + }
1177 +
1178 + mpm_state = AP_MPMQ_STOPPING;
1179 +
1180 + if (shutdown_pending) {
1181 + /* Time to gracefully shut down:
1182 + * Kill child processes, tell them to call child_exit, etc...
1183 + */
1184 + if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
1185 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGTERM");
1186 + }
1187 + ap_reclaim_child_processes(1); /* Start with SIGTERM */
1188 +
1189 + /* cleanup pid file on normal shutdown */
1190 + {
1191 + const char *pidfile = NULL;
1192 + pidfile = ap_server_root_relative (pconf, ap_pid_fname);
1193 + if ( pidfile != NULL && unlink(pidfile) == 0)
1194 + ap_log_error(APLOG_MARK, APLOG_INFO,
1195 + 0, ap_server_conf,
1196 + "removed PID file %s (pid=%ld)",
1197 + pidfile, (long)getpid());
1198 + }
1199 +
1200 + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
1201 + "caught SIGTERM, shutting down");
1202 + return 1;
1203 + }
1204 +
1205 + /* we've been told to restart */
1206 + apr_signal(SIGHUP, SIG_IGN);
1207 + if (one_process) {
1208 + /* not worth thinking about */
1209 + return 1;
1210 + }
1211 +
1212 + /* advance to the next generation */
1213 + /* XXX: we really need to make sure this new generation number isn't in
1214 + * use by any of the children.
1215 + */
1216 + ++ap_my_generation;
1217 + ap_scoreboard_image->global->running_generation = ap_my_generation;
1218 +
1219 + if (is_graceful) {
1220 + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
1221 + "Graceful restart requested, doing restart");
1222 +
1223 + /* kill off the idle ones */
1224 + ap_mpm_pod_killpg(pod, ap_max_daemons_limit);
1225 +
1226 + /* This is mostly for debugging... so that we know what is still
1227 + * gracefully dealing with existing request. This will break
1228 + * in a very nasty way if we ever have the scoreboard totally
1229 + * file-based (no shared memory)
1230 + */
1231 + for (index = 0; index < ap_daemons_limit; ++index) {
1232 + if (ap_scoreboard_image->servers[index][0].status != SERVER_DEAD) {
1233 + ap_scoreboard_image->servers[index][0].status = SERVER_GRACEFUL;
1234 + }
1235 + }
1236 + }
1237 + else {
1238 + /* Kill 'em off */
1239 + if (unixd_killpg(getpgrp(), SIGHUP) < 0) {
1240 + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGHUP");
1241 + }
1242 + ap_reclaim_child_processes(0); /* Not when just starting up */
1243 + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf,
1244 + "SIGHUP received. Attempting to restart");
1245 + }
1246 +
1247 + return 0;
1248 +}
1249 +
1250 +/* This really should be a post_config hook, but the error log is already
1251 + * redirected by that point, so we need to do this in the open_logs phase.
1252 + */
1253 +static int itk_open_logs(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
1254 +{
1255 + apr_status_t rv;
1256 +
1257 + pconf = p;
1258 + ap_server_conf = s;
1259 +
1260 + if ((num_listensocks = ap_setup_listeners(ap_server_conf)) < 1) {
1261 + ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_STARTUP, 0,
1262 + NULL, "no listening sockets available, shutting down");
1263 + return DONE;
1264 + }
1265 +
1266 + if ((rv = ap_mpm_pod_open(pconf, &pod))) {
1267 + ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_STARTUP, rv, NULL,
1268 + "Could not open pipe-of-death.");
1269 + return DONE;
1270 + }
1271 + return OK;
1272 +}
1273 +
1274 +static int itk_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
1275 +{
1276 + static int restart_num = 0;
1277 + int no_detach, debug, foreground;
1278 + apr_status_t rv;
1279 +
1280 + mpm_state = AP_MPMQ_STARTING;
1281 +
1282 + debug = ap_exists_config_define("DEBUG");
1283 +
1284 + if (debug) {
1285 + foreground = one_process = 1;
1286 + no_detach = 0;
1287 + }
1288 + else
1289 + {
1290 + no_detach = ap_exists_config_define("NO_DETACH");
1291 + one_process = ap_exists_config_define("ONE_PROCESS");
1292 + foreground = ap_exists_config_define("FOREGROUND");
1293 + }
1294 +
1295 + /* sigh, want this only the second time around */
1296 + if (restart_num++ == 1) {
1297 + is_graceful = 0;
1298 +
1299 + if (!one_process && !foreground) {
1300 + rv = apr_proc_detach(no_detach ? APR_PROC_DETACH_FOREGROUND
1301 + : APR_PROC_DETACH_DAEMONIZE);
1302 + if (rv != APR_SUCCESS) {
1303 + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
1304 + "apr_proc_detach failed");
1305 + return HTTP_INTERNAL_SERVER_ERROR;
1306 + }
1307 + }
1308 +
1309 + parent_pid = ap_my_pid = getpid();
1310 + }
1311 +
1312 + unixd_pre_config(ptemp);
1313 + ap_listen_pre_config();
1314 + ap_daemons_to_start = DEFAULT_START_DAEMON;
1315 + ap_daemons_min_free = DEFAULT_MIN_FREE_DAEMON;
1316 + ap_daemons_max_free = DEFAULT_MAX_FREE_DAEMON;
1317 + ap_daemons_limit = server_limit;
1318 + ap_pid_fname = DEFAULT_PIDLOG;
1319 + ap_lock_fname = DEFAULT_LOCKFILE;
1320 + ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
1321 + ap_extended_status = 0;
1322 +#ifdef AP_MPM_WANT_SET_MAX_MEM_FREE
1323 + ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
1324 +#endif
1325 +
1326 + apr_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir));
1327 +
1328 + return OK;
1329 +}
1330 +
1331 +static int itk_post_read(request_rec *r)
1332 +{
1333 + uid_t wanted_uid;
1334 + gid_t wanted_gid;
1335 + const char *wanted_username;
1336 + int err = 0;
1337 +
1338 + itk_server_conf *sconf =
1339 + (itk_server_conf *) ap_get_module_config(r->server->module_config, &mpm_itk_module);
1340 +
1341 + /* Enforce MaxClientsVhost. */
1342 + if (sconf->max_clients_vhost > 0) {
1343 + int i, num_other_servers = 0;
1344 + for (i = 0; i < ap_daemons_limit; ++i) {
1345 + worker_score *ws = &ap_scoreboard_image->servers[i][0];
1346 + if (ws->status >= SERVER_BUSY_READ && strncmp(ws->vhost, r->server->server_hostname, 31) == 0)
1347 + ++num_other_servers;
1348 + }
1349 +
1350 + if (num_other_servers > sconf->max_clients_vhost) {
1351 + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, \
1352 + "MaxClientsVhost reached for %s, refusing client.",
1353 + r->server->server_hostname);
1354 + return HTTP_SERVICE_UNAVAILABLE;
1355 + }
1356 + }
1357 +
1358 + strncpy(ap_scoreboard_image->servers[my_child_num][0].vhost, r->server->server_hostname, 31);
1359 + ap_scoreboard_image->servers[my_child_num][0].vhost[31] = 0;
1360 +
1361 + if (setpriority(PRIO_PROCESS, 0, sconf->nice_value)) {
1362 + _DBG("setpriority(): %s", strerror(errno));
1363 + err = 1;
1364 + }
1365 +
1366 + wanted_uid = sconf->uid;
1367 + wanted_gid = sconf->gid;
1368 + wanted_username = sconf->username;
1369 +
1370 + if (wanted_uid == -1 || wanted_gid == -1) {
1371 + wanted_uid = unixd_config.user_id;
1372 + wanted_gid = unixd_config.group_id;
1373 + wanted_username = unixd_config.user_name;
1374 + }
1375 +
1376 + if (!err && wanted_uid != -1 && wanted_gid != -1 && (getuid() != wanted_uid || getgid() != wanted_gid)) {
1377 + if (setgid(wanted_gid)) {
1378 + _DBG("setgid(): %s", strerror(errno));
1379 + err = 1;
1380 + } else if (initgroups(wanted_username, wanted_gid)) {
1381 + _DBG("initgroups(): %s", strerror(errno));
1382 + err = 1;
1383 + } else if (setuid(wanted_uid)) {
1384 + _DBG("setuid(): %s", strerror(errno));
1385 + err = 1;
1386 + }
1387 + }
1388 +
1389 + /*
1390 + * Most likely a case of switching uid/gid within a persistent
1391 + * connection; the RFCs allow us to just close the connection
1392 + * at anytime, so we excercise our right. :-)
1393 + */
1394 + if (err) {
1395 + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, \
1396 + "Couldn't set uid/gid/priority, closing connection.");
1397 + ap_lingering_close(r->connection);
1398 + exit(0);
1399 + }
1400 + return OK;
1401 +}
1402 +
1403 +static void itk_hooks(apr_pool_t *p)
1404 +{
1405 + /* The itk open_logs phase must run before the core's, or stderr
1406 + * will be redirected to a file, and the messages won't print to the
1407 + * console.
1408 + */
1409 + static const char *const aszSucc[] = {"core.c", NULL};
1410 +
1411 +#ifdef AUX3
1412 + (void) set42sig();
1413 +#endif
1414 +
1415 + ap_hook_open_logs(itk_open_logs, NULL, aszSucc, APR_HOOK_MIDDLE);
1416 + /* we need to set the MPM state before other pre-config hooks use MPM query
1417 + * to retrieve it, so register as REALLY_FIRST
1418 + */
1419 + ap_hook_pre_config(itk_pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
1420 +
1421 + /* set the uid as fast as possible */
1422 + ap_hook_post_read_request(itk_post_read, NULL, NULL, APR_HOOK_REALLY_FIRST);
1423 +}
1424 +
1425 +static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy, const char *arg)
1426 +{
1427 + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
1428 + if (err != NULL) {
1429 + return err;
1430 + }
1431 +
1432 + ap_daemons_to_start = atoi(arg);
1433 + return NULL;
1434 +}
1435 +
1436 +static const char *set_min_free_servers(cmd_parms *cmd, void *dummy, const char *arg)
1437 +{
1438 + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
1439 + if (err != NULL) {
1440 + return err;
1441 + }
1442 +
1443 + ap_daemons_min_free = atoi(arg);
1444 + if (ap_daemons_min_free <= 0) {
1445 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1446 + "WARNING: detected MinSpareServers set to non-positive.");
1447 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1448 + "Resetting to 1 to avoid almost certain Apache failure.");
1449 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1450 + "Please read the documentation.");
1451 + ap_daemons_min_free = 1;
1452 + }
1453 +
1454 + return NULL;
1455 +}
1456 +
1457 +static const char *set_max_free_servers(cmd_parms *cmd, void *dummy, const char *arg)
1458 +{
1459 + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
1460 + if (err != NULL) {
1461 + return err;
1462 + }
1463 +
1464 + ap_daemons_max_free = atoi(arg);
1465 + return NULL;
1466 +}
1467 +
1468 +static const char *set_max_clients (cmd_parms *cmd, void *dummy, const char *arg)
1469 +{
1470 + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
1471 + if (err != NULL) {
1472 + return err;
1473 + }
1474 +
1475 + ap_daemons_limit = atoi(arg);
1476 + if (ap_daemons_limit > server_limit) {
1477 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1478 + "WARNING: MaxClients of %d exceeds ServerLimit value "
1479 + "of %d servers,", ap_daemons_limit, server_limit);
1480 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1481 + " lowering MaxClients to %d. To increase, please "
1482 + "see the ServerLimit", server_limit);
1483 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1484 + " directive.");
1485 + ap_daemons_limit = server_limit;
1486 + }
1487 + else if (ap_daemons_limit < 1) {
1488 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1489 + "WARNING: Require MaxClients > 0, setting to 1");
1490 + ap_daemons_limit = 1;
1491 + }
1492 + return NULL;
1493 +}
1494 +
1495 +static const char *set_server_limit (cmd_parms *cmd, void *dummy, const char *arg)
1496 +{
1497 + int tmp_server_limit;
1498 +
1499 + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
1500 + if (err != NULL) {
1501 + return err;
1502 + }
1503 +
1504 + tmp_server_limit = atoi(arg);
1505 + /* you cannot change ServerLimit across a restart; ignore
1506 + * any such attempts
1507 + */
1508 + if (first_server_limit &&
1509 + tmp_server_limit != server_limit) {
1510 + /* how do we log a message? the error log is a bit bucket at this
1511 + * point; we'll just have to set a flag so that ap_mpm_run()
1512 + * logs a warning later
1513 + */
1514 + changed_limit_at_restart = 1;
1515 + return NULL;
1516 + }
1517 + server_limit = tmp_server_limit;
1518 +
1519 + if (server_limit > MAX_SERVER_LIMIT) {
1520 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1521 + "WARNING: ServerLimit of %d exceeds compile time limit "
1522 + "of %d servers,", server_limit, MAX_SERVER_LIMIT);
1523 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1524 + " lowering ServerLimit to %d.", MAX_SERVER_LIMIT);
1525 + server_limit = MAX_SERVER_LIMIT;
1526 + }
1527 + else if (server_limit < 1) {
1528 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1529 + "WARNING: Require ServerLimit > 0, setting to 1");
1530 + server_limit = 1;
1531 + }
1532 + return NULL;
1533 +}
1534 +
1535 +static const char *assign_user_id (cmd_parms *cmd, void *dummy, const char *user_name, const char *group_name)
1536 +{
1537 + itk_server_conf *sconf =
1538 + (itk_server_conf *) ap_get_module_config(cmd->server->module_config, &mpm_itk_module);
1539 + sconf->username = strdup(user_name);
1540 + sconf->uid = ap_uname2id(user_name);
1541 + sconf->gid = ap_gname2id(group_name);
1542 + return NULL;
1543 +}
1544 +
1545 +static const char *set_max_clients_vhost (cmd_parms *cmd, void *dummy, const char *arg)
1546 +{
1547 + itk_server_conf *sconf =
1548 + (itk_server_conf *) ap_get_module_config(cmd->server->module_config, &mpm_itk_module);
1549 + sconf->max_clients_vhost = atoi(arg);
1550 + return NULL;
1551 +}
1552 +
1553 +static const char *set_nice_value (cmd_parms *cmd, void *dummy, const char *arg)
1554 +{
1555 + itk_server_conf *sconf =
1556 + (itk_server_conf *) ap_get_module_config(cmd->server->module_config, &mpm_itk_module);
1557 + int nice_value = atoi(arg);
1558 +
1559 + if (nice_value < -20) {
1560 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1561 + "WARNING: NiceValue of %d is below -20, increasing NiceValue to -20.",
1562 + nice_value);
1563 + nice_value = -20;
1564 + }
1565 + else if (nice_value > 19) {
1566 + ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL,
1567 + "WARNING: NiceValue of %d is above 19, lowering NiceValue to 19.",
1568 + nice_value);
1569 + nice_value = 19;
1570 + }
1571 + sconf->nice_value = nice_value;
1572 + return NULL;
1573 +}
1574 +
1575 +static const command_rec itk_cmds[] = {
1576 +UNIX_DAEMON_COMMANDS,
1577 +LISTEN_COMMANDS,
1578 +AP_INIT_TAKE1("StartServers", set_daemons_to_start, NULL, RSRC_CONF,
1579 + "Number of child processes launched at server startup"),
1580 +AP_INIT_TAKE1("MinSpareServers", set_min_free_servers, NULL, RSRC_CONF,
1581 + "Minimum number of idle children, to handle request spikes"),
1582 +AP_INIT_TAKE1("MaxSpareServers", set_max_free_servers, NULL, RSRC_CONF,
1583 + "Maximum number of idle children"),
1584 +AP_INIT_TAKE1("MaxClients", set_max_clients, NULL, RSRC_CONF,
1585 + "Maximum number of children alive at the same time"),
1586 +AP_INIT_TAKE1("ServerLimit", set_server_limit, NULL, RSRC_CONF,
1587 + "Maximum value of MaxClients for this run of Apache"),
1588 +AP_INIT_TAKE2("AssignUserID", assign_user_id, NULL, RSRC_CONF,
1589 + "Tie a virtual host to a specific child process."),
1590 +AP_INIT_TAKE1("MaxClientsVHost", set_max_clients_vhost, NULL, RSRC_CONF,
1591 + "Maximum number of children alive at the same time for this virtual host."),
1592 +AP_INIT_TAKE1("NiceValue", set_nice_value, NULL, RSRC_CONF,
1593 + "Set nice value for the given vhost, from -20 (highest priority) to 19 (lowest priority)."),
1594 +{ NULL }
1595 +};
1596 +
1597 +/* == allocate a private server config structure == */
1598 +static void *itk_create_config(apr_pool_t *p, server_rec *s)
1599 +{
1600 + itk_server_conf *c = (itk_server_conf *)
1601 + apr_pcalloc(p, sizeof(itk_server_conf));
1602 + c->uid = c->gid = -1;
1603 + c->max_clients_vhost = -1;
1604 + c->nice_value = 0;
1605 + return c;
1606 +}
1607 +
1608 +module AP_MODULE_DECLARE_DATA mpm_itk_module = {
1609 + MPM20_MODULE_STUFF,
1610 + ap_mpm_rewrite_args, /* hook to run before apache parses args */
1611 + NULL, /* create per-directory config structure */
1612 + NULL, /* merge per-directory config structures */
1613 + itk_create_config, /* create per-server config structure */
1614 + NULL, /* merge per-server config structures */
1615 + itk_cmds, /* command apr_table_t */
1616 + itk_hooks, /* register hooks */
1617 +};
1618 --- /dev/null
1619 +++ b/server/mpm/experimental/itk/mpm.h
1620 @@ -0,0 +1,54 @@
1621 +/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
1622 + * applicable.
1623 + *
1624 + * Licensed under the Apache License, Version 2.0 (the "License");
1625 + * you may not use this file except in compliance with the License.
1626 + * You may obtain a copy of the License at
1627 + *
1628 + * http://www.apache.org/licenses/LICENSE-2.0
1629 + *
1630 + * Unless required by applicable law or agreed to in writing, software
1631 + * distributed under the License is distributed on an "AS IS" BASIS,
1632 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1633 + * See the License for the specific language governing permissions and
1634 + * limitations under the License.
1635 + *
1636 + * Portions copyright 2005-2007 Steinar H. Gunderson <sgunderson@bigfoot.com>.
1637 + * Licensed under the same terms as the rest of Apache.
1638 + */
1639 +
1640 +#include "httpd.h"
1641 +#include "mpm_default.h"
1642 +#include "scoreboard.h"
1643 +#include "unixd.h"
1644 +
1645 +#ifndef APACHE_MPM_ITK_H
1646 +#define APACHE_MPM_ITK_H
1647 +
1648 +#define ITK_MPM
1649 +
1650 +#define MPM_NAME "ITK"
1651 +
1652 +#define AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
1653 +#define AP_MPM_WANT_WAIT_OR_TIMEOUT
1654 +#define AP_MPM_WANT_PROCESS_CHILD_STATUS
1655 +#define AP_MPM_WANT_SET_PIDFILE
1656 +#define AP_MPM_WANT_SET_SCOREBOARD
1657 +#define AP_MPM_WANT_SET_LOCKFILE
1658 +#define AP_MPM_WANT_SET_MAX_REQUESTS
1659 +#define AP_MPM_WANT_SET_COREDUMPDIR
1660 +#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
1661 +#define AP_MPM_WANT_SIGNAL_SERVER
1662 +#define AP_MPM_WANT_SET_MAX_MEM_FREE
1663 +#define AP_MPM_WANT_FATAL_SIGNAL_HANDLER
1664 +#define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
1665 +
1666 +#define AP_MPM_USES_POD 1
1667 +#define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
1668 +#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
1669 +#define MPM_ACCEPT_FUNC unixd_accept
1670 +
1671 +extern int ap_threads_per_child;
1672 +extern int ap_max_daemons_limit;
1673 +extern server_rec *ap_server_conf;
1674 +#endif /* APACHE_MPM_ITK_H */
1675 --- /dev/null
1676 +++ b/server/mpm/experimental/itk/mpm_default.h
1677 @@ -0,0 +1,68 @@
1678 +/* Copyright 1999-2005 The Apache Software Foundation or its licensors, as
1679 + * applicable.
1680 + *
1681 + * Licensed under the Apache License, Version 2.0 (the "License");
1682 + * you may not use this file except in compliance with the License.
1683 + * You may obtain a copy of the License at
1684 + *
1685 + * http://www.apache.org/licenses/LICENSE-2.0
1686 + *
1687 + * Unless required by applicable law or agreed to in writing, software
1688 + * distributed under the License is distributed on an "AS IS" BASIS,
1689 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1690 + * See the License for the specific language governing permissions and
1691 + * limitations under the License.
1692 + *
1693 + * Portions copyright 2005-2007 Steinar H. Gunderson <sgunderson@bigfoot.com>.
1694 + * Licensed under the same terms as the rest of Apache.
1695 + */
1696 +
1697 +#ifndef APACHE_MPM_DEFAULT_H
1698 +#define APACHE_MPM_DEFAULT_H
1699 +
1700 +/* Number of servers to spawn off by default --- also, if fewer than
1701 + * this free when the caretaker checks, it will spawn more.
1702 + */
1703 +#ifndef DEFAULT_START_DAEMON
1704 +#define DEFAULT_START_DAEMON 5
1705 +#endif
1706 +
1707 +/* Maximum number of *free* server processes --- more than this, and
1708 + * they will die off.
1709 + */
1710 +
1711 +#ifndef DEFAULT_MAX_FREE_DAEMON
1712 +#define DEFAULT_MAX_FREE_DAEMON 10
1713 +#endif
1714 +
1715 +/* Minimum --- fewer than this, and more will be created */
1716 +
1717 +#ifndef DEFAULT_MIN_FREE_DAEMON
1718 +#define DEFAULT_MIN_FREE_DAEMON 5
1719 +#endif
1720 +
1721 +/* File used for accept locking, when we use a file */
1722 +#ifndef DEFAULT_LOCKFILE
1723 +#define DEFAULT_LOCKFILE DEFAULT_REL_RUNTIMEDIR "/accept.lock"
1724 +#endif
1725 +
1726 +/* Where the main/parent process's pid is logged */
1727 +#ifndef DEFAULT_PIDLOG
1728 +#define DEFAULT_PIDLOG DEFAULT_REL_RUNTIMEDIR "/httpd.pid"
1729 +#endif
1730 +
1731 +/*
1732 + * Interval, in microseconds, between scoreboard maintenance.
1733 + */
1734 +#ifndef SCOREBOARD_MAINTENANCE_INTERVAL
1735 +#define SCOREBOARD_MAINTENANCE_INTERVAL 1000000
1736 +#endif
1737 +
1738 +/* Number of requests to try to handle in a single process. If <= 0,
1739 + * the children don't die off.
1740 + */
1741 +#ifndef DEFAULT_MAX_REQUESTS_PER_CHILD
1742 +#define DEFAULT_MAX_REQUESTS_PER_CHILD 10000
1743 +#endif
1744 +
1745 +#endif /* AP_MPM_DEFAULT_H */

  ViewVC Help
Powered by ViewVC 1.1.20