Changes with Apache 2.3.0
[ When backported to 2.2.x, remove entry from this file ]
+ *) core: Handle unrecognised transfer-encodings.
+ PR 43882 [Nick Kew]
+
*) core: Avoid some unexpected connection closes by telling the client
that the connection is not persistent if the MPM process handling
the request is already exiting when the response header is built.
lenp = apr_table_get(f->r->headers_in, "Content-Length");
if (tenc) {
- if (!strcasecmp(tenc, "chunked")) {
+ /* RFC2616 allows qualifiers, so use strncasecmp */
+ if (!strncasecmp(tenc, "chunked", 7)) {
ctx->state = BODY_CHUNK;
}
+ else {
+ /* Something that isn't in HTTP, unless some future
+ * edition defines new transfer ecodings, is unsupported.
+ */
+ apr_bucket_brigade *bb;
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r,
+ "Unknown Transfer-Encoding: %s", tenc);
+ bb = apr_brigade_create(f->r->pool, f->c->bucket_alloc);
+ e = ap_bucket_error_create(HTTP_NOT_IMPLEMENTED, NULL,
+ f->r->pool, f->c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(bb, e);
+ e = apr_bucket_eos_create(f->c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(bb, e);
+ ctx->eos_sent = 1;
+ return ap_pass_brigade(f->r->output_filters, bb);
+ }
}
else if (lenp) {
char *endstr;