mpm_common.c revision 36cecf8d723f10ec217ebf7d0bbb8dab89f37f76
3955N/A/* ==================================================================== 3955N/A * The Apache Software License, Version 1.1 402N/A * Copyright (c) 2000 The Apache Software Foundation. All rights 402N/A * Redistribution and use in source and binary forms, with or without 402N/A * modification, are permitted provided that the following conditions 402N/A * 1. Redistributions of source code must retain the above copyright 3955N/A * notice, this list of conditions and the following disclaimer. 402N/A * 2. Redistributions in binary form must reproduce the above copyright 402N/A * notice, this list of conditions and the following disclaimer in 402N/A * the documentation and/or other materials provided with the 3955N/A * 3. The end-user documentation included with the redistribution, 4496N/A * if any, must include the following acknowledgment: 3955N/A * "This product includes software developed by the 3955N/A * Alternately, this acknowledgment may appear in the software itself, 3955N/A * if and wherever such third-party acknowledgments normally appear. 402N/A * 4. The names "Apache" and "Apache Software Foundation" must 402N/A * not be used to endorse or promote products derived from this 402N/A * software without prior written permission. For written 402N/A * permission, please contact apache@apache.org. 402N/A * 5. Products derived from this software may not be called "Apache", 402N/A * nor may "Apache" appear in their name, without prior written 3955N/A * permission of the Apache Software Foundation. 402N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 402N/A * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 402N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 402N/A * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 402N/A * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 402N/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 402N/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * ==================================================================== * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. /* The purpose of this file is to store the code that MOST mpm's will need * this does not mean a function only goes into this file if every MPM needs * it. It means that if a function is needed by more than one MPM, and * future maintenance would be served by making the code common, then the * This is going in src/main because it is not platform specific, it is * specific to multi-process servers, but NOT to Unix. Which is why it #
include <
sys/
time.h>
/* for timeval definitions */ long int waittime =
1024 *
16;
/* in usecs */ /* don't want to hold up progress any more than * necessary, but we need to allow children a few moments to exit. * Set delay with an exponential backoff. /* now see who is done */ /* ok, now it's being annoying */ "child process %ld still did not exit, sending a SIGTERM",
"child process %ld still did not exit, sending a SIGKILL",
/* sending a SIGKILL kills the entire team on BeOS, and as * httpd thread is part of that team it removes any chance * of ever doing a restart. To counter this I'm changing to * use a kinder, gentler way of killing a specific thread * that is just as effective. /* gave it our best shot, but alas... If this really * is a child we are trying to kill and it really hasn't * exited, we will likely fail to bind to the port "could not make child process %ld exit, " "attempting to continue anyway", (
long)
pid);
/* nothing left to wait for */ /* number of calls to wait_or_timeout between writable probes */ /* Child died... if it died due to a fatal error, * we should simply bail out. "child pid %ld exit signal %s (%d), " "possible coredump in %s",
"child pid %ld exit signal %s (%d)",
"child pid %ld exit signal %d",
/* The Nagle algorithm says that we should delay sending partial * packets in hopes of getting more data. We don't want to do * this; we are not telnet. There are bad interactions between * persistent connections and Nagle's algorithm that have very severe * performance penalties. (Failing to disable Nagle is not much of a * problem with simple HTTP.) * In spite of these problems, failure here is not a shooting offense. "setsockopt: (TCP_NODELAY)");