httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject Re: cvs commit: apache-2.0/src/modules/standard mod_actions.c mod_asis.c mod_autoindex.c mod_cgi.c mod_dir.c mod_include.c mod_mime.c mod_negotiation.c mod_userdir.c
Date Mon, 10 Jan 2000 01:40:06 GMT
On Sun, 9 Jan 2000 16:07:17 -0500 (EST), rbb@apache.org wrote:

>
>> >  -ap_status_t ap_get_filetype(ap_filetype_e *, ap_file_t *);
>> >  +ap_status_t ap_get_filetype(ap_filetype_e *, ap_fileperms_t);
>> 
>> This API change is not right. It assumes a file's type can be derived from a
>> ap_fileperms_t which is not true for all platforms, probably only true for
>> unix. The OS/2 implementation of ap_get_filetype() needs the file handle.
>
>This is actually harder to do than I had hoped.  The problem is that
>Apache no longer stores a copy of the file handle in the request
>structure.  Now, we store a pointer to an IOL, which if you follow far
>enough, you can resolve to a file handle.  This is what caused me to make
>this change originally.  I think we basically have a few options.
>
>1) Add a ap_iol_filetype which returns the file type from the IOL.
>
>2) Merge the IOL stuff into APR types.  This was discussed a while ago,
>and there are people who don't like this idea, but it does solve this
>problem.
>
>3) Re-design the IOL stuff to hide the internals a bit less.
>
>I really don't care what we do, but I see no way to redesign this code to
>fix the problem without affecting the IOL's in some big way.  I'll
>probably put this off until tomorrow, because I don't really feel like
>dealing with it today.

There's an easy way to do it, just add a filetype field to ap_finfo_t and set
it when doing the stat. This removes the need for ap_get_filetype()
altogether just like ap_get_filesize() & friends.

This also requires that tests like "S_ISDIR(finfo.protection)" are changed to
"finfo.filetype == APR_DIR".

I've already implemented this for OS/2 and have a running server using it. If
there are no objections I'll commit it.

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message