httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Wortham" <djwort...@gmail.com>
Subject Merge function not called when I would expect it to
Date Fri, 09 Feb 2007 23:54:24 GMT
Thanks to all of those who responded to my whitescreen/segfault problems.
It turns out I was 'allocing' memory for the newly created dir_cfg and for
an array of rbl_handler pointers, but not for each individual rbl_pointer
structure that the rbl_handler pointers pointed to.

Now that that's fixed, I am seeing something a little unexpected and am not
seeing something expected.

The relevant directory structure is shown below:
/* start httpd.conf excerpt */
<Directory ~ "/home/**/dev_***/(htdocs)"> # htdocs root
# ...
<Directory ~ "/home/**/dev_***/images"> # images root... given permissions
similar to htdocs
# ...
<Directory ~ "/home/**/dev_***/images/icons"> # I want the dir_cfg for this
directory to be created after a merge between it and it's FileSystem parent
(as defined just above)
/* end httpd.conf excerpt */

As I understand it, the dir_cfg_merge function should be called (assuming it
is defined and the function pointer is set in the module array) anytime one
directory is a child of a previously defined directory.

What I do see during httpd startup (you are seeing my debug outputs printed
to STDERR):
/* start merge function trace */
entered my_create_svr_conf for svr: "(null)"
entered my_create_dir_conf for dir: "(null)"

entered my_create_dir_conf for dir: "(null)"
entered my_create_svr_conf for svr: "127.0.0.1"

entered my_create_dir_conf for dir: "/home/dj/dev_unspam/(htdocs)"
entered my_create_dir_conf for dir: "/home/dj/dev_unspam/images"
entered my_create_dir_conf for dir: "/home/dj/dev_unspam/images/icons"

entered my_merge_svr_cfg
- parentsvr->hostname               = (null)
- childsvr->hostname                  = "127.0.0.1"
entered my_merge_dir_cfg
- parentdir->dirpath                  = (null)
- childdir->dirpath                    = (null)
/* end merge function trace */
(the "->dirpath" and "->hostname" are strings stored in the dir_cfg and
svr_cfg structs and are set during the "my_create_**r_cfg" functions.  I
have debug statements ensuring that these are set correctly in the **r_cfg
structs at the end of the "my_create_**r_cfg" function.)

I have tried the usual things:
- moving/decentralizing the configuration from "httpd.conf" into ".htaccess"
files stored in each directory (are those necessarily parsed at server
startup?)
- dumping the contents of the dir_cfg (and svr_cfg) structs to STDERR to see
if there is any other data which could potentially identify the
directory/server

My questions are:
- why is the merge_dir_cfg function being called with a blank (initialized
but never set) dir_cfg struct (at the end of the httpd process startup
trace)?
- why isn't merge_dir_cfg being called "between" the ".../images" and
".../images/icons/" dir_cfgs?  Why wouldn't these two directories need to be
set?
- are .htaccess files read immediately after the httpd.conf?  (my coworkers
seem to think they are read [and hence new dir_cfg structs are created]
during each HTTP request)


Any insight into the
(1) call order and call triggers for dir_cfg merge functions,
(2) differences between .htaccess and http.conf with regards to creating and
merging dir_cfgs, and
(3) differences between .htaccess and http.conf with regards to when each
one is read/parsed (during the life of the httpd process) and what effect
that has on making/changing cir_cfgs
would be very much appreciated.

Thanks,
Dave

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message