Loading include/mod_request.h +0 −23 Changes for include/mod_request.h: 0 added lines, 23 removed lines. Original line number Diff line number Diff line Loading @@ -52,26 +52,6 @@ typedef struct { int keep_body_set; } request_dir_conf; /* Handles for core filters */ extern AP_DECLARE_DATA ap_filter_rec_t *ap_keep_body_input_filter_handle; extern AP_DECLARE_DATA ap_filter_rec_t *ap_kept_body_input_filter_handle; /* Filter to set aside a kept body on subrequests */ AP_DECLARE(apr_status_t) ap_keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes); /* Filter to insert a kept body on subrequests */ AP_DECLARE(apr_status_t) ap_kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes); /* Optional function to add either the keep body filter or kept body filter as appropriate */ AP_DECLARE(void) ap_request_insert_filter(request_rec * r); /* Optional function to remove either the keep body filter or kept body filter as appropriate */ AP_DECLARE(void) ap_request_remove_filter(request_rec * r); /** * Structure to store the contents of an HTTP form of the type * application/x-www-form-urlencoded. Loading Loading @@ -117,9 +97,6 @@ typedef struct { * NOTE: File upload is not yet supported, but can be without change * to the function call. */ AP_DECLARE(int) ap_parse_request_form(request_rec * r, ap_filter_t * f, apr_array_header_t ** ptr, apr_size_t num, apr_size_t size); APR_DECLARE_OPTIONAL_FN(int, ap_parse_request_form, (request_rec * r, ap_filter_t * f, apr_array_header_t ** ptr, Loading modules/filters/mod_request.c +23 −20 Changes for modules/filters/mod_request.c: 23 added lines, 20 removed lines. Original line number Diff line number Diff line Loading @@ -34,8 +34,8 @@ #include "mod_request.h" /* Handles for core filters */ AP_DECLARE_DATA ap_filter_rec_t *ap_keep_body_input_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_kept_body_input_filter_handle; static ap_filter_rec_t *keep_body_input_filter_handle; static ap_filter_rec_t *kept_body_input_filter_handle; static apr_status_t bail_out_on_error(apr_bucket_brigade *bb, ap_filter_t *f, Loading @@ -62,8 +62,9 @@ typedef struct keep_body_filter_ctx { * This is the KEEP_BODY_INPUT filter for HTTP requests, for times when the * body should be set aside for future use by other modules. */ AP_DECLARE(apr_status_t) ap_keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, static apr_status_t keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { apr_bucket *e; Loading Loading @@ -197,9 +198,11 @@ static int kept_body_filter_init(ap_filter_t *f) { * If a body has been previously kept by the request, and if a subrequest wants * to re-insert the body into the request, this input filter makes it happen. */ AP_DECLARE(apr_status_t) ap_kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { static apr_status_t kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { request_rec *r = f->r; apr_bucket_brigade *kept_body = r->kept_body; kept_body_ctx_t *ctx = f->ctx; Loading Loading @@ -307,7 +310,7 @@ typedef enum { * NOTE: File upload is not yet supported, but can be without change * to the function call. */ AP_DECLARE(int) ap_parse_request_form(request_rec * r, ap_filter_t * f, static int ap_parse_request_form(request_rec * r, ap_filter_t * f, apr_array_header_t ** ptr, apr_size_t num, apr_size_t size) { Loading Loading @@ -499,20 +502,20 @@ static int request_is_filter_present(request_rec * r, ap_filter_rec_t *fn) * * @param r The request */ AP_DECLARE(void) ap_request_insert_filter(request_rec * r) static void ap_request_insert_filter(request_rec * r) { request_dir_conf *conf = ap_get_module_config(r->per_dir_config, &request_module); if (r->kept_body) { if (!request_is_filter_present(r, ap_kept_body_input_filter_handle)) { ap_add_input_filter_handle(ap_kept_body_input_filter_handle, if (!request_is_filter_present(r, kept_body_input_filter_handle)) { ap_add_input_filter_handle(kept_body_input_filter_handle, NULL, r, r->connection); } } else if (conf->keep_body) { if (!request_is_filter_present(r, ap_kept_body_input_filter_handle)) { ap_add_input_filter_handle(ap_keep_body_input_filter_handle, if (!request_is_filter_present(r, kept_body_input_filter_handle)) { ap_add_input_filter_handle(keep_body_input_filter_handle, NULL, r, r->connection); } } Loading @@ -522,12 +525,12 @@ AP_DECLARE(void) ap_request_insert_filter(request_rec * r) /** * Remove the kept_body and keep body filters from this specific request. */ AP_DECLARE(void) ap_request_remove_filter(request_rec * r) static void ap_request_remove_filter(request_rec * r) { ap_filter_t * f = r->input_filters; while (f) { if (f->frec->filter_func.in_func == ap_kept_body_filter || f->frec->filter_func.in_func == ap_keep_body_filter) { if (f->frec->filter_func.in_func == kept_body_filter || f->frec->filter_func.in_func == keep_body_filter) { ap_remove_input_filter(f); } f = f->next; Loading Loading @@ -579,11 +582,11 @@ static const command_rec request_cmds[] = { static void register_hooks(apr_pool_t *p) { ap_keep_body_input_filter_handle = ap_register_input_filter(KEEP_BODY_FILTER, ap_keep_body_filter, keep_body_input_filter_handle = ap_register_input_filter(KEEP_BODY_FILTER, keep_body_filter, NULL, AP_FTYPE_RESOURCE); ap_kept_body_input_filter_handle = ap_register_input_filter(KEPT_BODY_FILTER, ap_kept_body_filter, kept_body_input_filter_handle = ap_register_input_filter(KEPT_BODY_FILTER, kept_body_filter, kept_body_filter_init, AP_FTYPE_RESOURCE); ap_hook_insert_filter(ap_request_insert_filter, NULL, NULL, APR_HOOK_LAST); APR_REGISTER_OPTIONAL_FN(ap_parse_request_form); Loading Loading
include/mod_request.h +0 −23 Changes for include/mod_request.h: 0 added lines, 23 removed lines. Original line number Diff line number Diff line Loading @@ -52,26 +52,6 @@ typedef struct { int keep_body_set; } request_dir_conf; /* Handles for core filters */ extern AP_DECLARE_DATA ap_filter_rec_t *ap_keep_body_input_filter_handle; extern AP_DECLARE_DATA ap_filter_rec_t *ap_kept_body_input_filter_handle; /* Filter to set aside a kept body on subrequests */ AP_DECLARE(apr_status_t) ap_keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes); /* Filter to insert a kept body on subrequests */ AP_DECLARE(apr_status_t) ap_kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes); /* Optional function to add either the keep body filter or kept body filter as appropriate */ AP_DECLARE(void) ap_request_insert_filter(request_rec * r); /* Optional function to remove either the keep body filter or kept body filter as appropriate */ AP_DECLARE(void) ap_request_remove_filter(request_rec * r); /** * Structure to store the contents of an HTTP form of the type * application/x-www-form-urlencoded. Loading Loading @@ -117,9 +97,6 @@ typedef struct { * NOTE: File upload is not yet supported, but can be without change * to the function call. */ AP_DECLARE(int) ap_parse_request_form(request_rec * r, ap_filter_t * f, apr_array_header_t ** ptr, apr_size_t num, apr_size_t size); APR_DECLARE_OPTIONAL_FN(int, ap_parse_request_form, (request_rec * r, ap_filter_t * f, apr_array_header_t ** ptr, Loading
modules/filters/mod_request.c +23 −20 Changes for modules/filters/mod_request.c: 23 added lines, 20 removed lines. Original line number Diff line number Diff line Loading @@ -34,8 +34,8 @@ #include "mod_request.h" /* Handles for core filters */ AP_DECLARE_DATA ap_filter_rec_t *ap_keep_body_input_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_kept_body_input_filter_handle; static ap_filter_rec_t *keep_body_input_filter_handle; static ap_filter_rec_t *kept_body_input_filter_handle; static apr_status_t bail_out_on_error(apr_bucket_brigade *bb, ap_filter_t *f, Loading @@ -62,8 +62,9 @@ typedef struct keep_body_filter_ctx { * This is the KEEP_BODY_INPUT filter for HTTP requests, for times when the * body should be set aside for future use by other modules. */ AP_DECLARE(apr_status_t) ap_keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, static apr_status_t keep_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { apr_bucket *e; Loading Loading @@ -197,9 +198,11 @@ static int kept_body_filter_init(ap_filter_t *f) { * If a body has been previously kept by the request, and if a subrequest wants * to re-insert the body into the request, this input filter makes it happen. */ AP_DECLARE(apr_status_t) ap_kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { static apr_status_t kept_body_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) { request_rec *r = f->r; apr_bucket_brigade *kept_body = r->kept_body; kept_body_ctx_t *ctx = f->ctx; Loading Loading @@ -307,7 +310,7 @@ typedef enum { * NOTE: File upload is not yet supported, but can be without change * to the function call. */ AP_DECLARE(int) ap_parse_request_form(request_rec * r, ap_filter_t * f, static int ap_parse_request_form(request_rec * r, ap_filter_t * f, apr_array_header_t ** ptr, apr_size_t num, apr_size_t size) { Loading Loading @@ -499,20 +502,20 @@ static int request_is_filter_present(request_rec * r, ap_filter_rec_t *fn) * * @param r The request */ AP_DECLARE(void) ap_request_insert_filter(request_rec * r) static void ap_request_insert_filter(request_rec * r) { request_dir_conf *conf = ap_get_module_config(r->per_dir_config, &request_module); if (r->kept_body) { if (!request_is_filter_present(r, ap_kept_body_input_filter_handle)) { ap_add_input_filter_handle(ap_kept_body_input_filter_handle, if (!request_is_filter_present(r, kept_body_input_filter_handle)) { ap_add_input_filter_handle(kept_body_input_filter_handle, NULL, r, r->connection); } } else if (conf->keep_body) { if (!request_is_filter_present(r, ap_kept_body_input_filter_handle)) { ap_add_input_filter_handle(ap_keep_body_input_filter_handle, if (!request_is_filter_present(r, kept_body_input_filter_handle)) { ap_add_input_filter_handle(keep_body_input_filter_handle, NULL, r, r->connection); } } Loading @@ -522,12 +525,12 @@ AP_DECLARE(void) ap_request_insert_filter(request_rec * r) /** * Remove the kept_body and keep body filters from this specific request. */ AP_DECLARE(void) ap_request_remove_filter(request_rec * r) static void ap_request_remove_filter(request_rec * r) { ap_filter_t * f = r->input_filters; while (f) { if (f->frec->filter_func.in_func == ap_kept_body_filter || f->frec->filter_func.in_func == ap_keep_body_filter) { if (f->frec->filter_func.in_func == kept_body_filter || f->frec->filter_func.in_func == keep_body_filter) { ap_remove_input_filter(f); } f = f->next; Loading Loading @@ -579,11 +582,11 @@ static const command_rec request_cmds[] = { static void register_hooks(apr_pool_t *p) { ap_keep_body_input_filter_handle = ap_register_input_filter(KEEP_BODY_FILTER, ap_keep_body_filter, keep_body_input_filter_handle = ap_register_input_filter(KEEP_BODY_FILTER, keep_body_filter, NULL, AP_FTYPE_RESOURCE); ap_kept_body_input_filter_handle = ap_register_input_filter(KEPT_BODY_FILTER, ap_kept_body_filter, kept_body_input_filter_handle = ap_register_input_filter(KEPT_BODY_FILTER, kept_body_filter, kept_body_filter_init, AP_FTYPE_RESOURCE); ap_hook_insert_filter(ap_request_insert_filter, NULL, NULL, APR_HOOK_LAST); APR_REGISTER_OPTIONAL_FN(ap_parse_request_form); Loading