mod_mime.c revision 8d89aea1726567c698b5c24e82b4a951f498e588
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg/* ====================================================================
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * The Apache Software License, Version 1.1
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * reserved.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * Redistribution and use in source and binary forms, with or without
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * modification, are permitted provided that the following conditions
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * 1. Redistributions of source code must retain the above copyright
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * notice, this list of conditions and the following disclaimer.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * 2. Redistributions in binary form must reproduce the above copyright
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * notice, this list of conditions and the following disclaimer in
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * the documentation and/or other materials provided with the
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * distribution.
7190e58eec40192c9719d2f2593471eda14e7e7cfuankg * 3. The end-user documentation included with the redistribution,
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * if any, must include the following acknowledgment:
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * "This product includes software developed by the
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * Apache Software Foundation (http://www.apache.org/)."
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * Alternately, this acknowledgment may appear in the software itself,
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * if and wherever such third-party acknowledgments normally appear.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * 4. The names "Apache" and "Apache Software Foundation" must
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * not be used to endorse or promote products derived from this
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * software without prior written permission. For written
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * permission, please contact apache@apache.org.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg * 5. Products derived from this software may not be called "Apache",
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * nor may "Apache" appear in their name, without prior written
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * permission of the Apache Software Foundation.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * SUCH DAMAGE.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * ====================================================================
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * This software consists of voluntary contributions made by many
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * individuals on behalf of the Apache Software Foundation. For more
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * information on the Apache Software Foundation, please see
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * Portions of this software are based upon public domain software
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * originally written at the National Center for Supercomputing Applications,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * University of Illinois, Urbana-Champaign.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * http_mime.c: Sends/gets MIME headers for requests
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes * Rob McCool
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes/* XXXX - fix me / EBCDIC
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * there was a cludge here which would use its
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * own version apr_isascii(). Indicating that
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg * on some platforms that might be needed.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * #define OS_ASC(c) (c) -- for mere mortals
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * #define OS_ASC(c) (ebcdic2ascii[c]) -- for dino's
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * #define apr_isascii(c) ((OS_ASC(c) & 0x80) == 0)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes/* XXXXX - fix me - See note with NOT_PROXY
bb2b38cd44b032118359afbc743efbea12f48e61bnicholestypedef struct attrib_info {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes/* Information to which an extension can be mapped
bb2b38cd44b032118359afbc743efbea12f48e61bnicholestypedef struct extension_info {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *forced_type; /* Additional AddTyped stuff */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *encoding_type; /* Added with AddEncoding... */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *language_type; /* Added with AddLanguage... */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *charset_type; /* Added with AddCharset... */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *input_filters; /* Added with AddInputFilter... */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *output_filters; /* Added with AddOutputFilter... */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholestypedef struct {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes apr_hash_t *extension_mappings; /* Map from extension name to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * extension_info structure */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes apr_array_header_t *remove_mappings; /* A simple list, walked once */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *default_language; /* Language if no AddLanguage ext found */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes int multimatch; /* Extensions to include in multiview matching
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg * for filenames, e.g. Filters and Handlers
bb2b38cd44b032118359afbc743efbea12f48e61bnicholestypedef struct param_s {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholestypedef struct {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstatic char tspecial[] = {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstatic void *create_mime_dir_config(apr_pool_t *p, char *dummy)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes (mime_dir_config *) apr_palloc(p, sizeof(mime_dir_config));
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes * Overlay one hash table of extension_mappings onto another
41022996c916eb4ab2ec3204eb491b64779eb100bnicholesstatic void *overlay_extension_mappings(apr_pool_t *p,
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes const void *key,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes const void *data)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes extension_info *new_info = apr_palloc(p, sizeof(extension_info));
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes const extension_info *overlay_info = (const extension_info *)overlay_val;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes const extension_info *base_info = (const extension_info *)base_val;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes memcpy(new_info, base_info, sizeof(extension_info));
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new_info->forced_type = overlay_info->forced_type;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new_info->encoding_type = overlay_info->encoding_type;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new_info->language_type = overlay_info->language_type;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new_info->charset_type = overlay_info->charset_type;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new_info->input_filters = overlay_info->input_filters;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new_info->output_filters = overlay_info->output_filters;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes/* Member is the offset within an extension_info of the pointer to reset
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgstatic void remove_items(apr_pool_t *p, apr_array_header_t *remove,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes attrib_info *suffix = (attrib_info *) remove->elts;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if (exinfo && *(const char**)((char *)exinfo + suffix[i].offset)) {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes exinfo = (extension_info*)apr_palloc(p, sizeof(*exinfo));
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes *(const char**)((char *)exinfo + suffix[i].offset) = NULL;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstatic void *merge_mime_dir_configs(apr_pool_t *p, void *basev, void *addv)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes mime_dir_config *base = (mime_dir_config *) basev;
56ab8639aed4d3b2f031d9c1160c5f40af01bdebjerenkrantz mime_dir_config *new = apr_palloc(p, sizeof(mime_dir_config));
be88e49281c5becee364ab9c6a0576f9b9844e0fbnicholes if (base->extension_mappings && add->extension_mappings) {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new->extension_mappings = apr_hash_merge(p, add->extension_mappings,
56ab8639aed4d3b2f031d9c1160c5f40af01bdebjerenkrantz new->extension_mappings = add->extension_mappings;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new->extension_mappings = base->extension_mappings;
f7d723f1ad88ed006c6caf4c2c6604b7c59dd172bnicholes /* We may not be merging the tables, but if we potentially will change
4f935de4900dc064a1e145be5e48f6af77ac24fcbnicholes * an exinfo member, then we are about to trounce it anyways.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * We must have a copy for safety.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if (new->extension_mappings && add->remove_mappings) {
5f2aaa2483c4526d7930df4a0e5844c1b7b6c9c0fuankg remove_items(p, add->remove_mappings, new->extension_mappings);
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes new->multimatch = (add->multimatch != MULTIMATCH_UNSET) ?
a400161a259d6d9fd47a47fd9a4bb413fd85e3bcsfstatic const char *add_extension_info(cmd_parms *cmd, void *m_,
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes exinfo = (extension_info*)apr_hash_get(m->extension_mappings, key,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes exinfo = apr_pcalloc(cmd->pool, sizeof(extension_info));
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * Note handler names are un-added with each per_dir_config merge.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * This keeps the association from being inherited, but not
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * from being re-added at a subordinate level.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstatic const char *remove_extension_info(cmd_parms *cmd, void *m_,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes const char *ext)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes m->remove_mappings = apr_array_make(cmd->pool, 4, sizeof(*suffix));
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes suffix = (attrib_info *) apr_array_push(m->remove_mappings);
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes/* The sole bit of server configuration that the MIME module has is
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes * the name of its config file, so...
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstatic const char *set_types_config(cmd_parms *cmd, void *dummy,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes const char *arg)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes ap_set_module_config(cmd->server->module_config, &mime_module,
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgstatic const char *multiviews_match(cmd_parms *cmd, void *m_,
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes const char *include)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if (m->multimatch && (m->multimatch & ~MULTIMATCH_ANY))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes return "Any is incompatible with NegotiatedOnly, "
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes "Filters and Handlers";
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes else if (strcasecmp(include, "NegotiatedOnly") == 0) {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if (m->multimatch && (m->multimatch & ~MULTIMATCH_NEGOTIATED))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes return "Any is incompatible with NegotiatedOnly, "
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg "Filters and Handlers";
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg if (m->multimatch && (m->multimatch & (MULTIMATCH_NEGOTIATED
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg return "Filters is incompatible with Any and NegotiatedOnly";
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg if (m->multimatch && (m->multimatch & (MULTIMATCH_NEGOTIATED
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg return "Handlers is incompatible with Any and NegotiatedOnly";
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg return "Unrecognized option";
d598e371878cc5aa4c3a2b77c814d9b55dbdb943fuankg (void *)APR_XtOffsetOf(extension_info, charset_type), OR_FILEINFO,
d598e371878cc5aa4c3a2b77c814d9b55dbdb943fuankg "a charset (e.g., iso-2022-jp), followed by one or more file extensions"),
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesAP_INIT_ITERATE2("AddEncoding", add_extension_info,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes (void *)APR_XtOffsetOf(extension_info, encoding_type), OR_FILEINFO,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes "an encoding (e.g., gzip), followed by one or more file extensions"),
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes (void *)APR_XtOffsetOf(extension_info, handler), OR_FILEINFO,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes "a handler name followed by one or more file extensions"),
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesAP_INIT_ITERATE2("AddInputFilter", add_extension_info,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes (void *)APR_XtOffsetOf(extension_info, input_filters), OR_FILEINFO,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes "input filter name (or ; delimited names) followed by one or more file extensions"),
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes (void *)APR_XtOffsetOf(extension_info, language_type), OR_FILEINFO,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes "a language (e.g., fr), followed by one or more file extensions"),
25b3aa26ee94824bb1e9ff2631aa1588b37e5f72fuankgAP_INIT_ITERATE2("AddOutputFilter", add_extension_info,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg (void *)APR_XtOffsetOf(extension_info, output_filters), OR_FILEINFO,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg "output filter name (or ; delimited names) followed by one or more file extensions"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankg (void *)APR_XtOffsetOf(extension_info, forced_type), OR_FILEINFO,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg "a mime type followed by one or more file extensions"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankg (void*)APR_XtOffsetOf(mime_dir_config, default_language), OR_FILEINFO,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg "language to use for documents with no other language file extension"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankgAP_INIT_ITERATE("MultiviewsMatch", multiviews_match, NULL, OR_FILEINFO,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg "NegotiatedOnly (default), Handlers and/or Filters, or Any"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankgAP_INIT_ITERATE("RemoveCharset", remove_extension_info,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg (void *)APR_XtOffsetOf(extension_info, charset_type), OR_FILEINFO,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg "one or more file extensions"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankgAP_INIT_ITERATE("RemoveEncoding", remove_extension_info,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg (void *)APR_XtOffsetOf(extension_info, encoding_type), OR_FILEINFO,
4883fd339815130dbe680e816ef00256e10b844ffuankg "one or more file extensions"),
f2f3f241c00a7a4bd597e57a19023940e072918abnicholesAP_INIT_ITERATE("RemoveHandler", remove_extension_info,
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankg (void *)APR_XtOffsetOf(extension_info, handler), OR_FILEINFO,
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankg "one or more file extensions"),
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankgAP_INIT_ITERATE("RemoveInputFilter", remove_extension_info,
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankg (void *)APR_XtOffsetOf(extension_info, input_filters), OR_FILEINFO,
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankg "one or more file extensions"),
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankgAP_INIT_ITERATE("RemoveLanguage", remove_extension_info,
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankg (void *)APR_XtOffsetOf(extension_info, language_type), OR_FILEINFO,
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankg "one or more file extensions"),
755d7c84cbdd7bad94beede1d6b5a6526d3a1ccdfuankgAP_INIT_ITERATE("RemoveOutputFilter", remove_extension_info,
4883fd339815130dbe680e816ef00256e10b844ffuankg (void *)APR_XtOffsetOf(extension_info, output_filters), OR_FILEINFO,
4883fd339815130dbe680e816ef00256e10b844ffuankg "one or more file extensions"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankg (void *)APR_XtOffsetOf(extension_info, forced_type), OR_FILEINFO,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg "one or more file extensions"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankgAP_INIT_TAKE1("TypesConfig", set_types_config, NULL, RSRC_CONF,
8209b79780530f392dee6e459468d5e9eb0a4299fuankg "the MIME types config file"),
8209b79780530f392dee6e459468d5e9eb0a4299fuankgstatic void mime_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg const char *types_confname = ap_get_module_config(s->module_config, &mime_module);
2711ba83bd97ebdc2c9276f31a5364ea106078f4fuankg types_confname = ap_server_root_relative(p, types_confname);
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if ((status = ap_pcfg_openfile(&f, ptemp, types_confname)) != APR_SUCCESS) {
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes "could not open mime types config file %s.", types_confname);
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if (l[0] == '#')
25b3aa26ee94824bb1e9ff2631aa1588b37e5f72fuankg while (ll[0]) {
ap_cfg_closefile(f);
static char *zap_sp(char *s)
char *tp;
if (s == NULL) {
return (NULL);
static int is_token(char c)
int res;
return res;
static int is_qtext(char c)
int res;
return res;
static int is_quoted_pair(char *s)
if (apr_isascii(c)) {
return (res);
int quoted = 0;
(const char *) mp);
return (NULL);
return (NULL);
cp++;
return (NULL);
return (ctp);
cp++;
return (NULL);
cp++;
cp++;
return (NULL);
cp++;
return (NULL);
return (NULL);
cp++;
quoted = 0;
if (quoted > 0) {
cp++;
cp++;
cp++;
return(NULL);
quoted = 0;
return (NULL);
cp++;
return (NULL);
return (NULL);
quoted = 0;
cp++;
return (ctp);
char *ext;
int found_metadata = 0;
return OK;
&mime_module);
++fn;
* The base name is always the first exception (i.e., "txt.html" has
int found;
found = 0;
#ifdef CASE_BLIND_FILESYSTEM
if (!r->content_languages)
if (!r->content_encoding)
r->content_encoding,
NULL);
while (*filters
while (*filters
if (found_metadata) {
(void *)exception_list);
if (r->content_type) {
char *ct;
int override = 0;
if (!override) {
NULL);
NULL);
NULL);
const char **new;
if (!r->content_languages)
if (!r->content_type)
return DECLINED;
return OK;