listen.c revision f565372276b78ef58318da589cfbddce0694852b
6201N/A/* ==================================================================== 6201N/A * The Apache Software License, Version 1.1 6201N/A * Copyright (c) 2000 The Apache Software Foundation. All rights 6201N/A * Redistribution and use in source and binary forms, with or without 6201N/A * modification, are permitted provided that the following conditions 6201N/A * 1. Redistributions of source code must retain the above copyright 6201N/A * notice, this list of conditions and the following disclaimer. 6201N/A * 2. Redistributions in binary form must reproduce the above copyright 6201N/A * notice, this list of conditions and the following disclaimer in 6201N/A * the documentation and/or other materials provided with the 6201N/A * 3. The end-user documentation included with the redistribution, 6201N/A * if any, must include the following acknowledgment: 6201N/A * "This product includes software developed by the 6201N/A * Alternately, this acknowledgment may appear in the software itself, 6201N/A * if and wherever such third-party acknowledgments normally appear. 6201N/A * 4. The names "Apache" and "Apache Software Foundation" must 6201N/A * not be used to endorse or promote products derived from this 6201N/A * software without prior written permission. For written 6201N/A * permission, please contact apache@apache.org. 6201N/A * 5. Products derived from this software may not be called "Apache", 6201N/A * nor may "Apache" appear in their name, without prior written 6201N/A * permission of the Apache Software Foundation. 6201N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 6201N/A * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 6201N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 6201N/A * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 6201N/A * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 6201N/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 6201N/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 6201N/A * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 6201N/A * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 7291N/A * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 7291N/A * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 6201N/A * ==================================================================== 6201N/A * This software consists of voluntary contributions made by many 6201N/A * individuals on behalf of the Apache Software Foundation. For more 6201N/A * information on the Apache Software Foundation, please see 6201N/A * Portions of this software are based upon public domain software 6201N/A * originally written at the National Center for Supercomputing Applications, 6201N/A * University of Illinois, Urbana-Champaign. /* TODO: make_sock is just begging and screaming for APR abstraction */ "make_sock: for %s, setsockopt: (SO_REUSEADDR)",
addr);
"make_sock: for %s, setsockopt: (SO_KEEPALIVE)",
addr);
* To send data over high bandwidth-delay connections at full * speed we must force the TCP window to open wide enough to keep the * pipe full. The default window size on many systems * is only 4kB. Cross-country WAN connections of 100ms * at 1Mb/s are not impossible for well connected sites. * If we assume 100ms cross-country latency, * a 4kB buffer limits throughput to 40kB/s. * To avoid this problem I've added the SendBufferSize directive * to allow the web master to configure send buffer size. * The trade-off of larger buffers is that more kernel memory * is consumed. YMMV, know your customers and your network! * -John Heidemann <johnh@isi.edu> 25-Oct-96 * If no size is specified, use the kernel default. "make_sock: failed to set SendBufferSize for %s, " "make_sock: could not bind to %s",
addr);
"make_sock: unable to listen for connections on %s",
addr);
/* see if we've got an old listener for this address:port */ /* re-use existing record */ /* this has to survive restarts */ "make_sock: failed to get a socket for %s",
addr);
/* allocate a default listener if necessary */ /* close the old listeners */ return "Missing IP address";
else if (
ports[
1] ==
'\0') {
return "Address must end in :<port-number>";
return "Port must be numeric";
return "ListenBacklog must be > 0";
return "SendBufferSize must be >= 512 bytes, or 0 for system default.";