mod_file_cache.c revision 12901074f5d6b36d08be84d8637b6f2c21e0da26
51323288fc628a5cac50914df915545d685b793eLennart Poettering/* ====================================================================
51323288fc628a5cac50914df915545d685b793eLennart Poettering * The Apache Software License, Version 1.1
51323288fc628a5cac50914df915545d685b793eLennart Poettering * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
51323288fc628a5cac50914df915545d685b793eLennart Poettering * Redistribution and use in source and binary forms, with or without
51323288fc628a5cac50914df915545d685b793eLennart Poettering * modification, are permitted provided that the following conditions
51323288fc628a5cac50914df915545d685b793eLennart Poettering * 1. Redistributions of source code must retain the above copyright
51323288fc628a5cac50914df915545d685b793eLennart Poettering * notice, this list of conditions and the following disclaimer.
51323288fc628a5cac50914df915545d685b793eLennart Poettering * 2. Redistributions in binary form must reproduce the above copyright
51323288fc628a5cac50914df915545d685b793eLennart Poettering * notice, this list of conditions and the following disclaimer in
51323288fc628a5cac50914df915545d685b793eLennart Poettering * the documentation and/or other materials provided with the
51323288fc628a5cac50914df915545d685b793eLennart Poettering * distribution.
51323288fc628a5cac50914df915545d685b793eLennart Poettering * 3. The end-user documentation included with the redistribution,
51323288fc628a5cac50914df915545d685b793eLennart Poettering * if any, must include the following acknowledgment:
51323288fc628a5cac50914df915545d685b793eLennart Poettering * "This product includes software developed by the
51323288fc628a5cac50914df915545d685b793eLennart Poettering * Apache Software Foundation (http://www.apache.org/)."
51323288fc628a5cac50914df915545d685b793eLennart Poettering * Alternately, this acknowledgment may appear in the software itself,
b05f5ae7c5a95f44a59e5d2251879d0ef2af9cb2Lennart Poettering * if and wherever such third-party acknowledgments normally appear.
b05f5ae7c5a95f44a59e5d2251879d0ef2af9cb2Lennart Poettering * 4. The names "Apache" and "Apache Software Foundation" must
4e5bf5e15899de3f9d11c2ddfe9721d9f8b07a37Daniel Mack * not be used to endorse or promote products derived from this
4e5bf5e15899de3f9d11c2ddfe9721d9f8b07a37Daniel Mack * software without prior written permission. For written
b05f5ae7c5a95f44a59e5d2251879d0ef2af9cb2Lennart Poettering * permission, please contact apache@apache.org.
b05f5ae7c5a95f44a59e5d2251879d0ef2af9cb2Lennart Poettering * 5. Products derived from this software may not be called "Apache",
b05f5ae7c5a95f44a59e5d2251879d0ef2af9cb2Lennart Poettering * nor may "Apache" appear in their name, without prior written
931851e8e492a4d2715e22dcde50a5e7ccef4b49Lennart Poettering * permission of the Apache Software Foundation.
45ec7efb6c2560c80dfa752bc9d3733749dc52cbLennart Poettering * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
4e5bf5e15899de3f9d11c2ddfe9721d9f8b07a37Daniel Mack * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
4e5bf5e15899de3f9d11c2ddfe9721d9f8b07a37Daniel Mack * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
4e5bf5e15899de3f9d11c2ddfe9721d9f8b07a37Daniel Mack * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
#include "apr.h"
#include "apr_mmap.h"
#include "apr_strings.h"
#include "apr_hash.h"
#include "apr_buckets.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#define CORE_PRIVATE
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_core.h"
#if APR_HAS_SENDFILE
const char *filename;
int is_mmapped;
#if APR_HAS_MMAP
} a_file;
return sconf;
#if APR_HAS_MMAP
#if APR_HAS_SENDFILE
return APR_SUCCESS;
const char *fspec;
if (!fspec) {
#if APR_HAS_MMAP
if (mmap) {
#if APR_HAS_SENDFILE
if (!mmap) {
#if APR_HAS_SENDFILE
return NULL;
#if APR_HAS_MMAP
return NULL;
return OK;
int res;
return DECLINED;
return res;
return DECLINED;
return OK;
#if APR_HAS_MMAP
apr_bucket *b;
c->bucket_alloc);
return HTTP_INTERNAL_SERVER_ERROR;
return OK;
#if APR_HAS_SENDFILE
apr_bucket *b;
return HTTP_INTERNAL_SERVER_ERROR;
return OK;
int errstatus;
* see comment in http_core.c:default_handler
return DECLINED;
return DECLINED;
return errstatus;
char *datestr;
ap_set_etag(r);
return errstatus;
if (!r->header_only) {
return rc;
{NULL}