httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@znep.com>
Subject Re: [PATCH] remove some more strdup calls
Date Mon, 30 Jul 2001 06:40:02 GMT
On Sun, 29 Jul 2001, Brian Pane wrote:

> Marc Slemko wrote:
> 
> >On Sun, 29 Jul 2001, Brian Pane wrote:
> >
> >>Here's another small performance patch to remove calls
> >>to apr_pstrdup, this time in location_walk.
> >>
> >
> >erm... doesn't this change mean that we are mucking with r->uri directly
> >by calling ap_no2slash() on it?  Isn't that a problem and the whole point
> >behind the strdup?  r->uri should remain the original one, not the one 
> >with whatever fixups we use for whatever reason...
> >
> Please forgive me if I'm just missing something obvious,
> but why would leaving redundant slashes in r->uri be
> considered a good thing?  It seems like this only makes
> life more complicated for downstream code, because any
> module that does transformations based on URI must
> be prepared to deal with redundant slashes too.

They are only "redundant" when dealing with things mapped to a filesystem
or other particular location where they don't matter.  There are a lot of
things that code trying to map URIs to "something else" has to deal with.

AFAIK, in the spec, http://server/some/path and http://server/some//path
are not equivalent URIs.

also note the comment just above there:

    /* Location and LocationMatch differ on their behaviour w.r.t. multiple
     * slashes.  Location matches multiple slashes with a single slash,
     * LocationMatch doesn't.  An exception, for backwards brokenness is
     * absoluteURIs... in which case neither match multiple slashes.
     */

and note how the code a bit later on uses either r->uri or test_location
very carefully depending on if it is locationmatch or location.  This is
this way on purpose, and is documented beavior.  

It is annoying and perhaps could have been done better if starting from
ground zero, but there are no easy answers to dealing with such things...


Mime
View raw message