diff options
author | Ryan Bloom <rbb@apache.org> | 2000-11-22 20:38:07 +0100 |
---|---|---|
committer | Ryan Bloom <rbb@apache.org> | 2000-11-22 20:38:07 +0100 |
commit | 02f60b7ea4b0736130ba48289ee920cc52c80449 (patch) | |
tree | 309e47aa409a672215cc7dca255207049e87e6b6 /modules/http | |
parent | minor cleaning: provider ids are no longer used (diff) | |
download | apache2-02f60b7ea4b0736130ba48289ee920cc52c80449.tar.xz apache2-02f60b7ea4b0736130ba48289ee920cc52c80449.zip |
Allow modules to specify the first module for a sub-request. This allows
modules to not have to muck with the output_filter after it creates the
sub-request. Without this change, modules that create a sub-request have
to manually edit the output_filters, and therefore skip the sub-request
output_filter. If they skip the sub-request output_filter, then we end
up sending multiple EOS buckets to the core_output_filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87065 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http')
-rw-r--r-- | modules/http/http_core.c | 2 | ||||
-rw-r--r-- | modules/http/http_request.c | 25 |
2 files changed, 20 insertions, 7 deletions
diff --git a/modules/http/http_core.c b/modules/http/http_core.c index a9dfd1faf2..f6c7e99c19 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -3009,7 +3009,7 @@ static int default_handler(request_rec *r) ap_set_last_modified(r); ap_set_etag(r); apr_table_setn(r->headers_out, "Accept-Ranges", "bytes"); - ap_set_content_length(r, r->finfo.size); + ap_set_content_length(r, r->finfo.size); if ((errstatus = ap_meets_conditions(r)) != OK) { apr_close(fd); return errstatus; diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 17bdf53838..3da29e49ea 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -806,7 +806,8 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f, AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, const char *new_file, - const request_rec *r) + const request_rec *r, + ap_filter_t *next_filter) { request_rec *rnew; int res; @@ -830,7 +831,12 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, ap_copy_method_list(rnew->allowed_methods, r->allowed_methods); /* start with the same set of output filters */ - rnew->output_filters = r->output_filters; + if (next_filter) { + rnew->output_filters = next_filter; + } + else { + rnew->output_filters = r->output_filters; + } ap_add_output_filter("SUBREQ_CORE", NULL, rnew, rnew->connection); /* no input filters for a subrequest */ @@ -902,13 +908,15 @@ AP_DECLARE(request_rec *) ap_sub_req_method_uri(const char *method, } AP_DECLARE(request_rec *) ap_sub_req_lookup_uri(const char *new_file, - const request_rec *r) + const request_rec *r, + ap_filter_t *next_filter) { - return ap_sub_req_method_uri("GET", new_file, r); + return ap_sub_req_method_uri("GET", new_file, r, next_filter); } AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file, - const request_rec *r) + const request_rec *r, + ap_filter_t *next_filter) { request_rec *rnew; int res; @@ -932,7 +940,12 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file, ap_copy_method_list(rnew->allowed_methods, r->allowed_methods); /* start with the same set of output filters */ - rnew->output_filters = r->output_filters; + if (next_filter) { + rnew->output_filters = next_filter; + } + else { + rnew->output_filters = r->output_filters; + } ap_add_output_filter("SUBREQ_CORE", NULL, rnew, rnew->connection); /* no input filters for a subrequest */ |