httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Please define "canonicalize" in httpd.h
Date Mon, 02 Aug 2004 18:00:49 GMT
William A. Rowe, Jr. wrote:
> At 02:35 PM 8/1/2004, Stas Bekman wrote:
> 
>>John Rowe wrote:
>>
>>>>Please define "canonicalize" 
>>>
>>>In the context of case-insensitive file systems, it's often the case
>>>that a file is given the canonical name that it was created with
>>>("MyFile") with all other capitalisations ("myfile", "myfilE") being
>>>alternative names for the same filename. 
>>
>>Thanks John. I understand all that. My request was to fix the following XXX in httpd.h:
>>
>>struct request_rec {
>>...
>>   /* XXX: What does this mean? Please define "canonicalize" -aaron */
>>   /** The true filename, we canonicalize r->filename if these don't match */
>>   char *canonical_filename;
>>
>>and explain there when one should use canonical_filename, instead of filename. The
comment:
>>
>>/** The true filename, we canonicalize r->filename if these don't match */
>>
>>suggests that r->filename is getting canonized as well.
> 
> 
> Yes - you don't generally play with r->canonical_filename (in fact, it should
> become private) unless you are the module who is responsible for it.  Only
> things like the core file handler, which happens to dig through the segments,
> eliminate /foo/../ sorts of elements, and checks the filesystem case as it
> goes will bother to set this.
> 
> When we hit the dir_walk on win32, the system compares filename to the
> canonical_filename.  If they match - dir_walk won't bother to re-canonicalize
> the (matching) segments of the name.  This, at least, is the theory.
> 
> This should possibly be better 'hidden' - in the sense that it is probably
> just confusing cruft to most module authors.

Excellent. Thanks Bill!

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message