summaryrefslogtreecommitdiff
path: root/modules/http
diff options
context:
space:
mode:
authorStefan Fritsch <sf@sfritsch.de>2011-12-27 19:42:53 +0100
committerStefan Fritsch <sf@sfritsch.de>2011-12-27 19:42:53 +0100
commitdb26b587c04799e75b6dd0fcd4b46aaa168f9161 (patch)
tree127af2f77fd3eddb75604ebecedeeea163325078 /modules/http
parentd9f98b967bedecc0bffe82682d1ed4e06c9df687 (diff)
downloadapache2-db26b587c04799e75b6dd0fcd4b46aaa168f9161.tar.gz
Upstream tarball 2.2.15upstream/2.2.15
Diffstat (limited to 'modules/http')
-rw-r--r--modules/http/byterange_filter.c2
-rw-r--r--modules/http/http_filters.c9
-rw-r--r--modules/http/http_request.c3
-rw-r--r--modules/http/mod_mime.c21
4 files changed, 29 insertions, 6 deletions
diff --git a/modules/http/byterange_filter.c b/modules/http/byterange_filter.c
index a25d1e59..e38d366e 100644
--- a/modules/http/byterange_filter.c
+++ b/modules/http/byterange_filter.c
@@ -308,7 +308,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f,
APR_BRIGADE_INSERT_TAIL(bsend, e);
/* we're done with the original content - all of our data is in bsend. */
- apr_brigade_destroy(bb);
+ apr_brigade_cleanup(bb);
/* send our multipart output */
return ap_pass_brigade(f->next, bsend);
diff --git a/modules/http/http_filters.c b/modules/http/http_filters.c
index f7f86df4..7fbc3692 100644
--- a/modules/http/http_filters.c
+++ b/modules/http/http_filters.c
@@ -524,6 +524,11 @@ apr_status_t ap_http_filter(ap_filter_t *f, apr_bucket_brigade *b,
if (ctx->state != BODY_NONE) {
ctx->remaining -= totalread;
+ if (ctx->remaining > 0) {
+ e = APR_BRIGADE_LAST(b);
+ if (APR_BUCKET_IS_EOS(e))
+ return APR_EOF;
+ }
}
/* If we have no more bytes remaining on a C-L request,
@@ -1115,7 +1120,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
ctx = f->ctx = apr_pcalloc(r->pool, sizeof(header_filter_ctx));
}
else if (ctx->headers_sent) {
- apr_brigade_destroy(b);
+ apr_brigade_cleanup(b);
return OK;
}
}
@@ -1286,7 +1291,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f,
ap_pass_brigade(f->next, b2);
if (r->header_only) {
- apr_brigade_destroy(b);
+ apr_brigade_cleanup(b);
ctx->headers_sent = 1;
return OK;
}
diff --git a/modules/http/http_request.c b/modules/http/http_request.c
index fe10a196..3a7e5ef9 100644
--- a/modules/http/http_request.c
+++ b/modules/http/http_request.c
@@ -353,6 +353,8 @@ static request_rec *internal_internal_redirect(const char *new_uri,
new->method_number = r->method_number;
new->allowed_methods = ap_make_method_list(new->pool, 2);
ap_parse_uri(new, new_uri);
+ new->parsed_uri.port_str = r->parsed_uri.port_str;
+ new->parsed_uri.port = r->parsed_uri.port;
new->request_config = ap_create_request_config(r->pool);
@@ -386,7 +388,6 @@ static request_rec *internal_internal_redirect(const char *new_uri,
new->err_headers_out = r->err_headers_out;
new->subprocess_env = rename_original_env(r->pool, r->subprocess_env);
new->notes = apr_table_make(r->pool, 5);
- new->allowed_methods = ap_make_method_list(new->pool, 2);
new->htaccess = r->htaccess;
new->no_cache = r->no_cache;
diff --git a/modules/http/mod_mime.c b/modules/http/mod_mime.c
index d9d8b101..eed6ebd9 100644
--- a/modules/http/mod_mime.c
+++ b/modules/http/mod_mime.c
@@ -274,6 +274,16 @@ static const char *add_extension_info(cmd_parms *cmd, void *m_,
}
/*
+ * As RemoveType should also override the info from TypesConfig, we add an
+ * empty string as type instead of actually removing the type.
+ */
+static const char *remove_extension_type(cmd_parms *cmd, void *m_,
+ const char *ext)
+{
+ return add_extension_info(cmd, m_, "", ext);
+}
+
+/*
* Note handler names are un-added with each per_dir_config merge.
* This keeps the association from being inherited, but not
* from being re-added at a subordinate level.
@@ -312,6 +322,12 @@ static const char *multiviews_match(cmd_parms *cmd, void *m_,
const char *include)
{
mime_dir_config *m = (mime_dir_config *) m_;
+ const char *errmsg;
+
+ errmsg = ap_check_cmd_context(cmd, NOT_IN_LOCATION);
+ if (errmsg != NULL) {
+ return errmsg;
+ }
if (strcasecmp(include, "Any") == 0) {
if (m->multimatch && (m->multimatch & ~MULTIMATCH_ANY)) {
@@ -397,7 +413,7 @@ static const command_rec mime_cmds[] =
AP_INIT_ITERATE("RemoveOutputFilter", remove_extension_info,
(void *)APR_OFFSETOF(extension_info, output_filters), OR_FILEINFO,
"one or more file extensions"),
- AP_INIT_ITERATE("RemoveType", remove_extension_info,
+ AP_INIT_ITERATE("RemoveType", remove_extension_type,
(void *)APR_OFFSETOF(extension_info, forced_type), OR_FILEINFO,
"one or more file extensions"),
AP_INIT_TAKE1("TypesConfig", set_types_config, NULL, RSRC_CONF,
@@ -809,7 +825,8 @@ static int find_ct(request_rec *r)
if (exinfo != NULL) {
- if (exinfo->forced_type) {
+ /* empty string is treated as special case for RemoveType */
+ if (exinfo->forced_type && *exinfo->forced_type) {
ap_set_content_type(r, exinfo->forced_type);
found = 1;
}