Changes with Apache 2.0.23-dev
+ *) Make the includes filter check return codes from filters lower in
+ the filter chain. If a lower level filter returns an error, then
+ the request needs to stop immediately. This allows mod_include to
+ stop parsing data once a lower filter recognizes an error.
+ [Ryan Bloom]
+
*) Add the ability to extend the methods that Apache understands
and have those methods <limit>able in the httpd.conf. It uses
the same bit mask/shifted offset as the original HTTP methods
/* -------------------------- The main function --------------------------- */
-static void send_parsed_content(apr_bucket_brigade **bb, request_rec *r,
- ap_filter_t *f)
+static apr_status_t send_parsed_content(apr_bucket_brigade **bb,
+ request_rec *r, ap_filter_t *f)
{
include_ctx_t *ctx = f->ctx;
apr_bucket *dptr = APR_BRIGADE_FIRST(*bb);
apr_bucket *tmp_dptr;
apr_bucket_brigade *tag_and_after;
int ret;
+ apr_status_t rv;
if (r->args) { /* add QUERY stuff to env cause it ain't yet */
char *arg_copy = apr_pstrdup(r->pool, r->args);
else if ((tmp_dptr != NULL) && (ctx->bytes_parsed >= BYTE_COUNT_THRESHOLD)) {
/* Send the large chunk of pre-tag bytes... */
tag_and_after = apr_brigade_split(*bb, tmp_dptr);
- ap_pass_brigade(f->next, *bb);
+ rv = ap_pass_brigade(f->next, *bb);
+ if (rv != APR_SUCCESS) {
+ return rv;
+ }
*bb = tag_and_after;
dptr = tmp_dptr;
ctx->bytes_parsed = 0;
} while (dptr != APR_BRIGADE_SENTINEL(*bb));
}
else { /* Otherwise pass it along... */
- ap_pass_brigade(f->next, *bb); /* No SSI tags in this brigade... */
+ rv = ap_pass_brigade(f->next, *bb); /* No SSI tags in this brigade... */
+ if (rv != APR_SUCCESS) {
+ return rv;
+ }
ctx->bytes_parsed = 0;
}
}
/* Set aside tag, pass pre-tag... */
tag_and_after = apr_brigade_split(*bb, ctx->head_start_bucket);
ap_save_brigade(f, &ctx->ssi_tag_brigade, &tag_and_after, r->pool);
- ap_pass_brigade(f->next, *bb);
+ rv = ap_pass_brigade(f->next, *bb);
+ if (rv != APR_SUCCESS) {
+ return rv;
+ }
ctx->bytes_parsed = 0;
}
}
request_rec *r = f->r;
include_ctx_t *ctx = f->ctx;
request_rec *parent;
+ apr_status_t rv;
include_dir_config *conf =
(include_dir_config *)ap_get_module_config(r->per_dir_config,
&include_module);
ctx->error_length = strlen(ctx->error_str);
}
else {
- ap_pass_brigade(f->next, b);
- return APR_ENOMEM;
+ return ap_pass_brigade(f->next, b);
}
}
else {
*/
apr_table_unset(f->r->headers_out, "Content-Length");
- send_parsed_content(&b, r, f);
+ rv = send_parsed_content(&b, r, f);
if (parent) {
/* signify that the sub request should not be killed */
NESTED_INCLUDE_MAGIC);
}
- return APR_SUCCESS;
+ return rv;
}
static void ap_register_include_handler(char *tag, include_handler_fn_t *func)