You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ruediger Pluem <rp...@apache.org> on 2010/07/11 15:49:40 UTC
Re: svn commit: r962989 - in /httpd/httpd/branches/2.2.x: CHANGES
STATUS docs/manual/mod/mod_dir.xml modules/mappers/mod_dir.c
On 07/11/2010 07:58 AM, niq@apache.org wrote:
> Author: niq
> Date: Sun Jul 11 05:58:13 2010
> New Revision: 962989
>
> URL: http://svn.apache.org/viewvc?rev=962989&view=rev
> Log:
> Backport FallbackResource directive.
>
> Modified:
> httpd/httpd/branches/2.2.x/CHANGES
> httpd/httpd/branches/2.2.x/STATUS
> httpd/httpd/branches/2.2.x/docs/manual/mod/mod_dir.xml
> httpd/httpd/branches/2.2.x/modules/mappers/mod_dir.c
>
> @@ -90,9 +94,53 @@ static void *merge_dir_configs(apr_pool_
> new->index_names = add->index_names ? add->index_names : base->index_names;
> new->do_slash =
> (add->do_slash == SLASH_UNSET) ? base->do_slash : add->do_slash;
> + new->dflt = add->dflt ? add->dflt : base->dflt;
> return new;
> }
>
> +static int fixup_dflt(request_rec *r)
> +{
> + dir_config_rec *d = ap_get_module_config(r->per_dir_config, &dir_module);
> + const char *name_ptr;
> + request_rec *rr;
> + int error_notfound = 0;
> + if ((r->finfo.filetype != APR_NOFILE) || (r->handler != NULL)) {
> + return DECLINED;
> + }
> + name_ptr = d->dflt;
What happens if d->dflt is NULL?
> + if (r->args != NULL) {
> + name_ptr = apr_pstrcat(r->pool, name_ptr, "?", r->args, NULL);
> + }
> + rr = ap_sub_req_lookup_uri(name_ptr, r, r->output_filters);
> + if (rr->status == HTTP_OK
> + && ( (rr->handler && !strcmp(rr->handler, "proxy-server"))
> + || rr->finfo.filetype == APR_REG)) {
> + ap_internal_fast_redirect(rr, r);
> + return OK;
> + }
> + else if (ap_is_HTTP_REDIRECT(rr->status)) {
> +
> + apr_pool_join(r->pool, rr->pool);
> + r->notes = apr_table_overlay(r->pool, r->notes, rr->notes);
> + r->headers_out = apr_table_overlay(r->pool, r->headers_out,
> + rr->headers_out);
> + r->err_headers_out = apr_table_overlay(r->pool, r->err_headers_out,
> + rr->err_headers_out);
> + error_notfound = rr->status;
> + }
> + else if (rr->status && rr->status != HTTP_NOT_FOUND
> + && rr->status != HTTP_OK) {
> + error_notfound = rr->status;
> + }
> +
> + ap_destroy_sub_req(rr);
> + if (error_notfound) {
> + return error_notfound;
> + }
> +
> + /* nothing for us to do, pass on through */
> + return DECLINED;
> +}
> static int fixup_dir(request_rec *r)
> {
> dir_config_rec *d;
Regards
Rüdiger
RE: svn commit: r962989 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS docs/manual/mod/mod_dir.xml modules/mappers/mod_dir.c
Posted by "Plüm, Rüdiger, VF-Group" <ru...@vodafone.com>.
> -----Original Message-----
> From: Nick Kew
> Sent: Sonntag, 11. Juli 2010 22:16
> To: dev@httpd.apache.org
> Subject: Re: svn commit: r962989 - in
> /httpd/httpd/branches/2.2.x: CHANGES STATUS
> docs/manual/mod/mod_dir.xml modules/mappers/mod_dir.c
>
> On 11 Jul 2010, at 14:49, Ruediger Pluem wrote:
> >> + name_ptr = d->dflt;
> >
> > What happens if d->dflt is NULL?
>
> Then I guess it would be a good idea to return DECLINED :)
>
> I guess strictly speaking, that should go through STATUS.
> Unless we cheat an additional check.
Definitely. Already made a proposal in STATUS. Without the
whole test suite breaks.
Regards
Rüdiger
Re: svn commit: r962989 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS docs/manual/mod/mod_dir.xml modules/mappers/mod_dir.c
Posted by Nick Kew <ni...@webthing.com>.
On 11 Jul 2010, at 14:49, Ruediger Pluem wrote:
>> + name_ptr = d->dflt;
>
> What happens if d->dflt is NULL?
Then I guess it would be a good idea to return DECLINED :)
I guess strictly speaking, that should go through STATUS.
Unless we cheat an additional check.
--
Nick Kew