if ((access_status = ap_run_translate_name(r))) {
return decl_die(access_status, "translate", r);
- return access_status;
}
}
* structure...
*/
-static request_rec *make_sub_request(const request_rec *r)
+static request_rec *make_sub_request(const request_rec *r,
+ ap_filter_t *next_filter)
{
apr_pool_t *rrp;
- request_rec *rr;
+ request_rec *rnew;
apr_pool_create(&rrp, r->pool);
- rr = apr_pcalloc(rrp, sizeof(request_rec));
- rr->pool = rrp;
- return rr;
-}
+ rnew = apr_pcalloc(rrp, sizeof(request_rec));
+ rnew->pool = rrp;
-static void fill_in_sub_req_vars(request_rec *rnew, const request_rec *r,
- ap_filter_t *next_filter)
-{
rnew->hostname = r->hostname;
rnew->request_time = r->request_time;
rnew->connection = r->connection;
/* no input filters for a subrequest */
ap_set_sub_req_protocol(rnew, r);
+
+ /* We have to run this after we fill in sub req vars,
+ * or the r->main pointer won't be setup
+ */
+ ap_run_create_request(rnew);
+
+ return rnew;
}
AP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
int res;
char *udir;
- rnew = make_sub_request(r);
- fill_in_sub_req_vars(rnew, r, next_filter);
-
- /* We have to run this after fill_in_sub_req_vars, or the r->main
- * pointer won't be setup
- */
- ap_run_create_request(rnew);
+ rnew = make_sub_request(r, next_filter);
/* would be nicer to pass "method" to ap_set_sub_req_protocol */
rnew->method = method;
char *fdir;
char *udir;
- rnew = make_sub_request(r);
- fill_in_sub_req_vars(rnew, r, next_filter);
-
- /* We have to run this after fill_in_sub_req_vars, or the r->main
- * pointer won't be setup
- */
- ap_run_create_request(rnew);
+ rnew = make_sub_request(r, next_filter);
/* Special case: we are looking at a relative lookup in the same directory.
* This is 100% safe, since dirent->name just came from the filesystem.
char *fdir;
apr_size_t fdirlen;
- rnew = make_sub_request(r);
- fill_in_sub_req_vars(rnew, r, next_filter);
-
- /* We have to run this after fill_in_sub_req_vars, or the r->main
- * pointer won't be setup
- */
- ap_run_create_request(rnew);
+ rnew = make_sub_request(r, next_filter);
fdir = ap_make_dirstr_parent(rnew->pool, r->filename);
fdirlen = strlen(fdir);