mod_asis.c revision 2fc50921b88defeb7127985dfe4b4130175e069e
0237f43ab925775250e266e479d0a337ff374a4btakashi/* ====================================================================
0237f43ab925775250e266e479d0a337ff374a4btakashi * The Apache Software License, Version 1.1
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd * reserved.
0237f43ab925775250e266e479d0a337ff374a4btakashi * Redistribution and use in source and binary forms, with or without
0237f43ab925775250e266e479d0a337ff374a4btakashi * modification, are permitted provided that the following conditions
0237f43ab925775250e266e479d0a337ff374a4btakashi * 1. Redistributions of source code must retain the above copyright
0237f43ab925775250e266e479d0a337ff374a4btakashi * notice, this list of conditions and the following disclaimer.
0237f43ab925775250e266e479d0a337ff374a4btakashi * 2. Redistributions in binary form must reproduce the above copyright
0237f43ab925775250e266e479d0a337ff374a4btakashi * notice, this list of conditions and the following disclaimer in
0237f43ab925775250e266e479d0a337ff374a4btakashi * the documentation and/or other materials provided with the
0237f43ab925775250e266e479d0a337ff374a4btakashi * distribution.
0237f43ab925775250e266e479d0a337ff374a4btakashi * 3. The end-user documentation included with the redistribution,
0237f43ab925775250e266e479d0a337ff374a4btakashi * if any, must include the following acknowledgment:
0237f43ab925775250e266e479d0a337ff374a4btakashi * "This product includes software developed by the
0237f43ab925775250e266e479d0a337ff374a4btakashi * Apache Software Foundation (http://www.apache.org/)."
0237f43ab925775250e266e479d0a337ff374a4btakashi * Alternately, this acknowledgment may appear in the software itself,
0237f43ab925775250e266e479d0a337ff374a4btakashi * if and wherever such third-party acknowledgments normally appear.
0237f43ab925775250e266e479d0a337ff374a4btakashi * 4. The names "Apache" and "Apache Software Foundation" must
0237f43ab925775250e266e479d0a337ff374a4btakashi * not be used to endorse or promote products derived from this
0237f43ab925775250e266e479d0a337ff374a4btakashi * software without prior written permission. For written
0237f43ab925775250e266e479d0a337ff374a4btakashi * permission, please contact apache@apache.org.
0237f43ab925775250e266e479d0a337ff374a4btakashi * 5. Products derived from this software may not be called "Apache",
0237f43ab925775250e266e479d0a337ff374a4btakashi * nor may "Apache" appear in their name, without prior written
0237f43ab925775250e266e479d0a337ff374a4btakashi * permission of the Apache Software Foundation.
0237f43ab925775250e266e479d0a337ff374a4btakashi * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
0237f43ab925775250e266e479d0a337ff374a4btakashi * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0237f43ab925775250e266e479d0a337ff374a4btakashi * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
de5cbc413070dea83e2d897c4a00dc6a80291227trawick * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
a99c5d4cc3cab6a62b04d52000dbc22ce1fa2d94coar * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0237f43ab925775250e266e479d0a337ff374a4btakashi * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0237f43ab925775250e266e479d0a337ff374a4btakashi * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
0237f43ab925775250e266e479d0a337ff374a4btakashi * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0237f43ab925775250e266e479d0a337ff374a4btakashi * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
0237f43ab925775250e266e479d0a337ff374a4btakashi * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
0237f43ab925775250e266e479d0a337ff374a4btakashi * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * SUCH DAMAGE.
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * ====================================================================
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * This software consists of voluntary contributions made by many
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * individuals on behalf of the Apache Software Foundation. For more
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * information on the Apache Software Foundation, please see
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * Portions of this software are based upon public domain software
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * originally written at the National Center for Supercomputing Applications,
e0872ce93f9e1cfe48431781fc43cde555e985c3trawick * University of Illinois, Urbana-Champaign.
0237f43ab925775250e266e479d0a337ff374a4btakashi const char *location;
de5cbc413070dea83e2d897c4a00dc6a80291227trawick if(strcmp(r->handler,ASIS_MAGIC_TYPE) && strcmp(r->handler,"send-as-is"))
de5cbc413070dea83e2d897c4a00dc6a80291227trawick ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
de5cbc413070dea83e2d897c4a00dc6a80291227trawick "file permissions deny server access: %s", r->filename);
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri location = apr_table_get(r->headers_out, "Location");
c44eeebd065e2c8cd028016b45c58afb480aaf8fdruggeri ((r->status == HTTP_OK) || ap_is_HTTP_REDIRECT(r->status))) {
0237f43ab925775250e266e479d0a337ff374a4btakashi /* Internal redirect -- fake-up a pseudo-request */
0237f43ab925775250e266e479d0a337ff374a4btakashi /* This redirect needs to be a GET no matter what the original
0237f43ab925775250e266e479d0a337ff374a4btakashi * method was.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar "mod_asis: failed to find end-of-headers position "
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar /* APR_HAS_LARGE_FILES issue; must split into mutiple buckets,
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar * no greater than MAX(apr_size_t), and more granular than that
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar * in case the brigade code/filters attempt to read it directly.
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar b->length = (apr_size_t)fsize; /* Resize just the last bucket */
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar b = apr_bucket_file_create(f, pos, (apr_size_t) (r->finfo.size - pos),
1f1b6bf13313fdd14a45e52e553d3ff28689b717coar "mod_asis: ap_pass_brigade failed for file %s", r->filename);