httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <c...@stdlib.net>
Subject Re: mod_dir + caching brokenness
Date Mon, 26 Sep 2005 10:23:00 GMT
On Wed, Sep 21, 2005 at 05:52:46PM +0100, Colm MacCarthaigh wrote:
> On Wed, Sep 21, 2005 at 05:27:49PM +0100, Colm MacCarthaigh wrote:
> > I'd like to apply this patch, but I have a feeling there must be some
> > undocumented reason it's not like this already. Any thoughts? 
> 
> Hmmm, some more testing shows that what's going on isn't nearly so
> simple. I'll come back with more.

I've been away the last few days, so I've only gotten around to
diagnosing this now, but the problem is really that mod_dir makes some
bad assumptions, that are not trivial to fix. 

r291588, which I've just committed, makes some changes to mod_cache
which at least makes the brokenness consistent and easier to debug, but
the problem is really with mod_dir.

mod_dir calls 

	rr = ap_sub_req_lookup_uri(name_ptr, r, NULL);

to lookup "/index.html", and this lookup calls the quickhandler. If the
cache quickhandler has "/index.html" cached it will return OK for that.

However problem 1; the mod_cache quick handler doesn't fill rr->finfo,
which means mod_dir ends up returning DECLINED, even though index.html
exists. Because the quickhandler for / added the CACHE_SAVE filter, we
end up serving a 304 response.

Now, problem 2; Fixing the fall-through won't work. mod_dir does a sub
request lookup, but it does not then do a subrequest. Instead it does a
redirect;

	ap_internal_fast_redirect(rr, r);

This is never going to work with the quickhandler, because the
quickhandler has already been called for the "r" request. mod_dir is a
fixup, so even if ap_sub_req_lookup_uri() returned OK, because the
quickhandler is willing to serve it; we're too late in the request
process for that to actually happen.

So, we need to either add a ap_sub_req_lookup_uri() equivalent that does
not lookup the quickhandler, or move mod_dir to being both a fixup and a
content handler and having it make an actual sub request.

Any ideas?

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Mime
View raw message