mod_vhost_alias.c revision 1ccd992d37d62c8cb2056126f2234f64ec189bfd
409N/A/* ==================================================================== 409N/A * The Apache Software License, Version 1.1 409N/A * Copyright (c) 2000 The Apache Software Foundation. All rights 409N/A * Redistribution and use in source and binary forms, with or without 409N/A * modification, are permitted provided that the following conditions 409N/A * 1. Redistributions of source code must retain the above copyright 409N/A * notice, this list of conditions and the following disclaimer. 409N/A * 2. Redistributions in binary form must reproduce the above copyright 409N/A * notice, this list of conditions and the following disclaimer in 409N/A * the documentation and/or other materials provided with the 409N/A * 3. The end-user documentation included with the redistribution, 409N/A * if any, must include the following acknowledgment: 409N/A * "This product includes software developed by the 5680N/A * Alternately, this acknowledgment may appear in the software itself, 409N/A * if and wherever such third-party acknowledgments normally appear. 409N/A * 4. The names "Apache" and "Apache Software Foundation" must 409N/A * not be used to endorse or promote products derived from this 409N/A * software without prior written permission. For written 409N/A * permission, please contact apache@apache.org. 844N/A * 5. Products derived from this software may not be called "Apache", 844N/A * nor may "Apache" appear in their name, without prior written 409N/A * permission of the Apache Software Foundation. 2899N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2899N/A * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 5680N/A * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 5680N/A * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 409N/A * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 409N/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 409N/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 409N/A * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 409N/A * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 5123N/A * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 5123N/A * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1639N/A * ==================================================================== 3817N/A * This software consists of voluntary contributions made by many 3817N/A * individuals on behalf of the Apache Software Foundation. For more 5933N/A * 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. * Copyright (c) 1998-1999 Demon Internet Ltd. * This software was submitted by Demon Internet to the Apache Software Foundation * in May 1999. Future revisions and derivatives of this source code * must acknowledge Demon Internet as the original contributor of * this module. All other licensing and usage conditions are those * of the Apache Software Foundation. * Originally written by Tony Finch <fanf@demon.net> <dot@dotat.at>. * Implementation ideas were taken from mod_alias.c. The overall * patch to Apache 1.3b3 and a similar feature in Demon's thttpd, * both written by James Grinter <jrg@blodwen.demon.co.uk>. * basic configuration things * we abbreviate "mod_vhost_alias" to "mva" for shorter names * Per-server module config record. * These are just here to tell us what vhost_alias_set should do. * We don't put anything into them; we just use the cell addresses. /* there ought to be a better way of doing this */ return "INTERNAL ERROR: unknown command info";
return "format string must start with '/' or be 'none'";
/* we just found a '%' */ if (*p ==
'p' || *p ==
'%') {
return "syntax error in format string";
return "syntax error in format string";
RSRC_CONF,
TAKE1,
"how to create the DocumentRoot based on the host"},
RSRC_CONF,
TAKE1,
"how to create the DocumentRoot based on the host"},
* This really wants to be a nested function * but C is too feeble to support them. /* XXX: what if size > HUGE_STRING_LEN? */ const char *
map,
const char *
uri)
/* we are in a format specifier */ /* no. of decimal digits in a short plus one */ /* deal with %-N+.-M+ -- syntax is already checked */ Np =
Mp = 0;
/* is there a plus? */ Nd =
Md = 0;
/* is there a dash? */ /* note that N and M are one-based indices, not zero-based */ start =
dots[0]+
1;
/* ptr to the first character */ end =
dots[
ndots];
/* ptr to the character after the last one */ else if (r->
uri[0] ==
'/') {
/* see is_scriptaliased() in mod_cgi */ NULL,
/* dir config creater */ NULL,
/* dir merger --- default is to override */