mod_mime.c revision 251430bcaff1fa6a77953bfe56475eb6cc7abc78
919N/A * http_mime.c: Sends/gets MIME headers for requests
561N/A#include "apr_strings.h"
561N/A#include "apr_hash.h"
970N/A#define APR_WANT_STRFUNC
970N/A#include "apr_want.h"
970N/A#include "ap_config.h"
1043N/A#include "http_config.h"
837N/A#include "http_log.h"
911N/A#include "http_request.h"
1043N/A#include "http_protocol.h"
typedef struct attrib_info {
char *name;
int offset;
} attrib_info;
typedef struct extension_info {
#define MULTIMATCH_UNSET 0
typedef struct param_s {
char *attr;
char *val;
} param;
const char *type;
const char *subtype;
} content_type;
static char tspecial[] = {
return new;
const void *key,
const void *overlay_val,
const void *base_val,
const void *data)
return new_info;
NULL);
return new;
++key;
if (!m->extension_mappings) {
if (!exinfo) {
return NULL;
const char *ext)
const char *ext)
++ext;
if (!m->remove_mappings) {
return NULL;
const char *arg)
(void *)arg);
return NULL;
const char *errmsg;
return errmsg;
| MULTIMATCH_ANY))) {
| MULTIMATCH_ANY))) {
return NULL;
{NULL}
ap_configfile_t *f;
char l[MAX_STRING_LEN];
&mime_module);
if (!types_confname) {
if (!types_confname) {
&mime_module));
return HTTP_INTERNAL_SERVER_ERROR;
!= APR_SUCCESS) {
return HTTP_INTERNAL_SERVER_ERROR;
while (ll[0]) {
ap_cfg_closefile(f);
return OK;
static const char *zap_sp(const char *s)
if (s == NULL) {
return (NULL);
start++;
end--;
if (len) {
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(const char *s)
if (apr_isascii(c)) {
return (res);
int quoted = 0;
mp = s;
cp++;
if (!*cp) {
(const char *) mp);
return (NULL);
cp++;
(const char *) mp);
return (NULL);
cp++;
(const char *) mp);
return (NULL);
cp++;
if (!*cp) {
return (NULL);
cp++;
cp++;
return (ctp);
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;
if (!r->filename) {
return DECLINED;
&mime_module);
++fn;
* The base name is always the first exception (i.e., "txt.html" has
int found;
char *extcase;
found = 0;
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) {
int override = 0;
*tmp = 0;
if (!override) {
r->content_type,
NULL));
r->content_type,
NULL));
NULL));
const char **new;
if (!r->content_languages) {
if (!r->content_type) {
return DECLINED;
return OK;