Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 84800 invoked by uid 500); 22 Nov 2000 19:38:12 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 84736 invoked by uid 500); 22 Nov 2000 19:38:11 -0000 Delivered-To: apmail-apache-2.0-cvs@apache.org Date: 22 Nov 2000 19:38:10 -0000 Message-ID: <20001122193810.84720.qmail@locus.apache.org> From: rbb@locus.apache.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/modules/standard mod_autoindex.c mod_dir.c mod_negotiation.c rbb 00/11/22 11:38:10 Modified: src CHANGES src/include http_request.h src/main http_core.c http_request.c util_script.c src/modules/standard mod_autoindex.c mod_dir.c mod_negotiation.c Log: 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. Revision Changes Path 1.347 +4 -0 apache-2.0/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-2.0/src/CHANGES,v retrieving revision 1.346 retrieving revision 1.347 diff -u -r1.346 -r1.347 --- CHANGES 2000/11/21 19:47:13 1.346 +++ CHANGES 2000/11/22 19:37:56 1.347 @@ -1,4 +1,8 @@ Changes with Apache 2.0a9 + *) Allow modules to specify the first filter in a sub_request when + making the sub_request. This keeps modules from having to change the + output_filter immediately after creating the sub-request, and therefore + skip the sub_req_output_filter. [Ryan Bloom] *) Update ab to accept URLs with IPv6 literal address strings (in the format described in RFC 2732), and to build Host header fields in 1.20 +13 -3 apache-2.0/src/include/http_request.h Index: http_request.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_request.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- http_request.h 2000/10/18 17:38:30 1.19 +++ http_request.h 2000/11/22 19:38:00 1.20 @@ -95,33 +95,43 @@ * inspected to find information about the requested URI * @param new_file The URI to lookup * @param r The current request + * @param next_filter The first filter the sub_request should use. If this is + * NULL, it defaults to the first filter for the main request * @return The new request record * @deffunc request_rec * ap_sub_req_lookup_uri(const char *new_file, const request_rec *r) */ 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); + /** * Create a sub request for the given file. This sub request can be * inspected to find information about the requested file * @param new_file The URI to lookup * @param r The current request + * @param next_filter The first filter the sub_request should use. If this is + * NULL, it defaults to the first filter for the main request * @return The new request record * @deffunc request_rec * ap_sub_req_lookup_file(const char *new_file, const request_rec *r) */ 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); /** * Create a sub request for the given URI using a specific method. This * sub request can be inspected to find information about the requested URI * @param method The method to use in the new sub request * @param new_file The URI to lookup * @param r The current request + * @param next_filter The first filter the sub_request should use. If this is + * NULL, it defaults to the first filter for the main request * @return The new request record * @deffunc request_rec * ap_sub_req_method_uri(const char *method, const char *new_file, const request_rec *r) */ 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); /** * An output filter to strip EOS buckets from sub-requests. This always * has to be inserted at the end of a sub-requests filter stack. 1.224 +1 -1 apache-2.0/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v retrieving revision 1.223 retrieving revision 1.224 diff -u -r1.223 -r1.224 --- http_core.c 2000/11/21 20:17:19 1.223 +++ http_core.c 2000/11/22 19:38:02 1.224 @@ -3009,7 +3009,7 @@ 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; 1.73 +19 -6 apache-2.0/src/main/http_request.c Index: http_request.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- http_request.c 2000/11/18 05:44:53 1.72 +++ http_request.c 2000/11/22 19:38:03 1.73 @@ -806,7 +806,8 @@ 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_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_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_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 */ 1.50 +2 -1 apache-2.0/src/main/util_script.c Index: util_script.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/util_script.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- util_script.c 2000/11/21 19:10:19 1.49 +++ util_script.c 2000/11/22 19:38:03 1.50 @@ -351,7 +351,8 @@ */ request_rec *pa_req; - pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info), r); + pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info), r, + NULL); if (pa_req->filename) { #ifdef WIN32 1.47 +3 -3 apache-2.0/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_autoindex.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- mod_autoindex.c 2000/11/10 19:01:32 1.46 +++ mod_autoindex.c 2000/11/22 19:38:06 1.47 @@ -974,7 +974,7 @@ * pretend there's nothing there. */ if ((header_fname != NULL) - && (rr = ap_sub_req_lookup_uri(header_fname, r)) + && (rr = ap_sub_req_lookup_uri(header_fname, r, NULL)) && (rr->status == HTTP_OK) && (rr->filename != NULL) && rr->finfo.filetype == APR_REG) { @@ -1057,7 +1057,7 @@ * pretend there's nothing there. */ if ((readme_fname != NULL) - && (rr = ap_sub_req_lookup_uri(readme_fname, r)) + && (rr = ap_sub_req_lookup_uri(readme_fname, r, NULL)) && (rr->status == HTTP_OK) && (rr->filename != NULL) && rr->finfo.filetype == APR_REG) { @@ -1184,7 +1184,7 @@ p->version_sort = autoindex_opts & VERSION_SORT; if (autoindex_opts & FANCY_INDEXING) { - request_rec *rr = ap_sub_req_lookup_file(name, r); + request_rec *rr = ap_sub_req_lookup_file(name, r, NULL); if (rr->finfo.protection != 0) { p->lm = rr->finfo.mtime; 1.21 +1 -1 apache-2.0/src/modules/standard/mod_dir.c Index: mod_dir.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_dir.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- mod_dir.c 2000/10/16 06:05:05 1.20 +++ mod_dir.c 2000/11/22 19:38:07 1.21 @@ -161,7 +161,7 @@ for (; num_names; ++names_ptr, --num_names) { char *name_ptr = *names_ptr; - request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r); + request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r, r->output_filters); if (rr->status == HTTP_OK && rr->finfo.filetype == APR_REG) { char *new_uri = ap_escape_uri(r->pool, rr->uri); 1.40 +3 -3 apache-2.0/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_negotiation.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- mod_negotiation.c 2000/10/16 06:05:06 1.39 +++ mod_negotiation.c 2000/11/22 19:38:07 1.40 @@ -949,7 +949,7 @@ * which we'll be slapping default_type on later). */ - sub_req = ap_sub_req_lookup_file(d_name, r); + sub_req = ap_sub_req_lookup_file(d_name, r, NULL); /* If it has a handler, we'll pretend it's a CGI script, * since that's a good indication of the sort of thing it @@ -2314,7 +2314,7 @@ if (!variant->sub_req) { int status; - sub_req = ap_sub_req_lookup_file(variant->file_name, r); + sub_req = ap_sub_req_lookup_file(variant->file_name, r, NULL); status = sub_req->status; if (status != HTTP_OK && @@ -2625,7 +2625,7 @@ * a sub_req structure yet. Get one now. */ - sub_req = ap_sub_req_lookup_file(best->file_name, r); + sub_req = ap_sub_req_lookup_file(best->file_name, r, NULL); if (sub_req->status != HTTP_OK) { res = sub_req->status; ap_destroy_sub_req(sub_req);