Issue Details (XML | Word | Printable)

Key: MODPYTHON-128
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Graham Dumpleton
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Have assigning req.filename automatically update req.finfo.

Created: 10/Feb/06 07:40 AM   Updated: 05/Apr/07 11:49 AM
Return to search
Component/s: core
Affects Version/s: 3.3.x
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works MP128_20060423_grahamd_1.diff 2006-04-23 05:39 PM Graham Dumpleton 1 kB
Issue Links:
Blocker
 

Resolution Date: 25/Aug/06 01:07 AM


 Description  « Hide
Although it is possible to assign a new value to "req.filename", it is not possible to update "req.finfo" based on the new filename.

Suggest that if "req.filename" is assigned a new value, that apr_stat() be automatically called to update "req.finfo". Ie., internally mod_python would do something like:

  apr_stat(&r->finfo, r->filename, APR_FINFO_MIN, r->pool);

I believe that mod_perl supports a similar feature, but would need to confirm this.

Related to "req.filename", the "req.canonical_filename" should also be writable as when changing "req.filename" the latter should also by rights be updated as well.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #386926 Sun Mar 19 04:50:08 UTC 2006 grahamd Added the filetype attribute of the Apache finfo structure to the tuple
returned when accessing req.finfo. This value is accessed using
req.finfo[apache.FINFO_FILETYPE]. New constants apache.APR_NOFILE,
apache.APR_REG, apache.APR_DIR etc, have been added for comparing with the
filetype value. (MODPYTHON-128)
Files Changed
MODIFY /httpd/mod_python/trunk/test/htdocs/tests.py
MODIFY /httpd/mod_python/trunk/src/util.c
MODIFY /httpd/mod_python/trunk/src/_apachemodule.c
MODIFY /httpd/mod_python/trunk/src/requestobject.c
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/apache.py

Repository Revision Date User Message
ASF #386935 Sun Mar 19 06:44:11 UTC 2006 grahamd Forgot to document that req.canonical_filename was made writable in previous
changes. (MODPYTHON-128)
Files Changed
MODIFY /httpd/mod_python/trunk/Doc/modpython4.tex
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex

Repository Revision Date User Message
ASF #434388 Thu Aug 24 12:42:59 UTC 2006 grahamd (MODPYTHON-128) Changed req.finfo to be an object where fields of underlying
fields of apr_finfo_t structure are accessed as object attributes. Tuple
style access is still maintained for backward compatability. The req.finfo
attribute is now also writable and can be assigned with the result of calling
new functions apache.stat() and apache.lstat().
Files Changed
MODIFY /httpd/mod_python/trunk/src/hlistobject.c
MODIFY /httpd/mod_python/trunk/src/_apachemodule.c
MODIFY /httpd/mod_python/trunk/src/include/mod_python.h
MODIFY /httpd/mod_python/trunk/Doc/modpython4.tex
MODIFY /httpd/mod_python/trunk/src/requestobject.c
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/__init__.py
ADD /httpd/mod_python/trunk/src/include/finfoobject.h
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/apache.py
ADD /httpd/mod_python/trunk/src/finfoobject.c
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h
MODIFY /httpd/mod_python/trunk/dist/setup.py.in
MODIFY /httpd/mod_python/trunk/src/include/mod_python.h.in
MODIFY /httpd/mod_python/trunk/src/Makefile.in

Repository Revision Date User Message
ASF #466618 Sun Oct 22 03:03:58 UTC 2006 grahamd (MODPYTHON-128) Removed apache.lstat() due to apr_lstat() having being
deprecated in Apache 2.2. Similar outcome can be had by supplying
APR_FINFO_LINK flag with arguments to apache.stat().
Files Changed
MODIFY /httpd/mod_python/trunk/src/_apachemodule.c
MODIFY /httpd/mod_python/trunk/Doc/modpython4.tex
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/__init__.py
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/apache.py
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h

Repository Revision Date User Message
ASF #478403 Thu Nov 23 00:08:36 UTC 2006 grahamd (MODPYTHON-128) The apache.stat() function, which is a wrapper for the
apr_stat() function, should still return a valid finfoobject when the
target of the apr_stat() call does not exist. This is instead of raising
an exception. This is necessary as otherwise there is no way of replacing
req.finfo with a finfoobject where req.finfo.filetype is APR_NOFILE. An
exception will only be raised now if a truly unexpected problem arises.
Callers of apache.stat() need to check finfo.filetype for APR_NOFILE if
they need to know if target existed or not.
Files Changed
MODIFY /httpd/mod_python/trunk/src/_apachemodule.c
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/__init__.py
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h