From: Greg Stein Date: Thu, 23 Nov 2000 13:03:46 +0000 (+0000) Subject: add the "next filter" parameter to the rest of the ap_sub_req_* calls. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9860c7c6044ad10387da73bff4e16a64975e801;p=apache add the "next filter" parameter to the rest of the ap_sub_req_* calls. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87076 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/arch/win32/mod_isapi.c b/modules/arch/win32/mod_isapi.c index bc2f3b9ab4..fd4ccc9646 100644 --- a/modules/arch/win32/mod_isapi.c +++ b/modules/arch/win32/mod_isapi.c @@ -816,7 +816,8 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, /* Map a URL to a filename */ char *file = (char *)lpvBuffer; DWORD len; - subreq = ap_sub_req_lookup_uri(apr_pstrndup(r->pool, file, *lpdwSize), r); + subreq = ap_sub_req_lookup_uri(apr_pstrndup(r->pool, file, *lpdwSize), + r, NULL); len = apr_cpystrn(file, subreq->filename, *lpdwSize) - file; @@ -996,7 +997,7 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, LPHSE_URL_MAPEX_INFO info = (LPHSE_URL_MAPEX_INFO) lpdwDataType; char* test_uri = apr_pstrndup(r->pool, (char *)lpvBuffer, *lpdwSize); - subreq = ap_sub_req_lookup_uri(test_uri, r); + subreq = ap_sub_req_lookup_uri(test_uri, r, NULL); info->cchMatchingURL = strlen(test_uri); info->cchMatchingPath = apr_cpystrn(info->lpszPath, subreq->filename, MAX_PATH) - info->lpszPath; diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 8731d65602..350dadc965 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -1359,6 +1359,9 @@ static int find_file(request_rec *r, const char *directive, const char *tag, } else { ap_getparents(tag_val); /* get rid of any nasties */ + + /* note: it is okay to pass NULL for the "next filter" since + we never attempt to "run" this sub request. */ rr = ap_sub_req_lookup_file(tag_val, r, NULL); if (rr->status == HTTP_OK && rr->finfo.protection != 0) { @@ -1387,6 +1390,8 @@ static int find_file(request_rec *r, const char *directive, const char *tag, return ret; } else if (!strcmp(tag, "virtual")) { + /* note: it is okay to pass NULL for the "next filter" since + we never attempt to "run" this sub request. */ rr = ap_sub_req_lookup_uri(tag_val, r, NULL); if (rr->status == HTTP_OK && rr->finfo.protection != 0) { diff --git a/modules/mappers/mod_dir.c b/modules/mappers/mod_dir.c index 76ccdc3ea9..dec70e3808 100644 --- a/modules/mappers/mod_dir.c +++ b/modules/mappers/mod_dir.c @@ -161,7 +161,7 @@ static int handle_dir(request_rec *r) for (; num_names; ++names_ptr, --num_names) { char *name_ptr = *names_ptr; - request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r, r->output_filters); + request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r, NULL); if (rr->status == HTTP_OK && rr->finfo.filetype == APR_REG) { char *new_uri = ap_escape_uri(r->pool, rr->uri); diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index ed3613e199..32168c20ac 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -2190,7 +2190,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, if (strlen(input) > 0 && subreq_ok(r)) { /* run a URI-based subrequest */ - rsub = ap_sub_req_lookup_uri(input, r); + rsub = ap_sub_req_lookup_uri(input, r, NULL); /* URI exists for any result up to 3xx, redirects allowed */ if (rsub->status < 400) @@ -2211,7 +2211,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, /* process a file-based subrequest: * this differs from -U in that no path translation is done. */ - rsub = ap_sub_req_lookup_file(input, r); + rsub = ap_sub_req_lookup_file(input, r, NULL); /* file exists for any result up to 2xx, no redirects */ if (rsub->status < 300 && @@ -3595,7 +3595,7 @@ static char *lookup_variable(request_rec *r, char *var) /* ...and sub and main paths differ */ \ && strcmp(r->main->uri, r->uri) != 0))) { \ /* process a file-based subrequest */ \ - rsub = subrecfunc(r->filename, r); \ + rsub = subrecfunc(r->filename, r, NULL); \ /* now recursively lookup the variable in the sub_req */ \ result = lookup_variable(rsub, var+5); \ /* copy it up to our scope before we destroy sub_req's apr_pool_t */ \ diff --git a/modules/metadata/mod_cern_meta.c b/modules/metadata/mod_cern_meta.c index f65909a7fa..f492cd9a6b 100644 --- a/modules/metadata/mod_cern_meta.c +++ b/modules/metadata/mod_cern_meta.c @@ -359,7 +359,7 @@ static int add_cern_meta_data(request_rec *r) * A better solution might be a "safe open" feature of pfopen to avoid * pipes, symlinks, and crap like that. */ - rr = ap_sub_req_lookup_file(metafilename, r); + rr = ap_sub_req_lookup_file(metafilename, r, NULL); if (rr->status != HTTP_OK) { ap_destroy_sub_req(rr); return DECLINED; diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index 66bb811370..d2ed7ef882 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -2347,7 +2347,7 @@ static int revision_suffix(request_rec *r) ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, 0, r, MODNAME ": subrequest lookup for %s", sub_filename); #endif /* MIME_MAGIC_DEBUG */ - sub = ap_sub_req_lookup_file(sub_filename, r); + sub = ap_sub_req_lookup_file(sub_filename, r, NULL); /* extract content type/encoding/language from sub-request */ if (sub->content_type) { diff --git a/modules/test/mod_autoindex.c b/modules/test/mod_autoindex.c index 3329d8da14..793fa19de4 100644 --- a/modules/test/mod_autoindex.c +++ b/modules/test/mod_autoindex.c @@ -974,7 +974,7 @@ static void emit_head(request_rec *r, char *header_fname, int suppress_amble, * 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 @@ static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble) * 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 @@ static struct ent *make_autoindex_entry(char *name, int autoindex_opts, 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; diff --git a/os/win32/mod_isapi.c b/os/win32/mod_isapi.c index bc2f3b9ab4..fd4ccc9646 100644 --- a/os/win32/mod_isapi.c +++ b/os/win32/mod_isapi.c @@ -816,7 +816,8 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, /* Map a URL to a filename */ char *file = (char *)lpvBuffer; DWORD len; - subreq = ap_sub_req_lookup_uri(apr_pstrndup(r->pool, file, *lpdwSize), r); + subreq = ap_sub_req_lookup_uri(apr_pstrndup(r->pool, file, *lpdwSize), + r, NULL); len = apr_cpystrn(file, subreq->filename, *lpdwSize) - file; @@ -996,7 +997,7 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest, LPHSE_URL_MAPEX_INFO info = (LPHSE_URL_MAPEX_INFO) lpdwDataType; char* test_uri = apr_pstrndup(r->pool, (char *)lpvBuffer, *lpdwSize); - subreq = ap_sub_req_lookup_uri(test_uri, r); + subreq = ap_sub_req_lookup_uri(test_uri, r, NULL); info->cchMatchingURL = strlen(test_uri); info->cchMatchingPath = apr_cpystrn(info->lpszPath, subreq->filename, MAX_PATH) - info->lpszPath;