On 11/03/2010 12:41 AM, Stefan Fritsch wrote:
> Hi,
>
> while working on ap_expr, I stumbled on the hook sorting being wrong
> while the config is processed. There is an entry in STATUS about it
> and I think I have found the reason. In main.c, there is the following
> calling order:
>
> ap_read_config(): loads the modules (through EXEC_ON_READ) and
> calls the modules' register_hooks functions. Also explicitly
> registers a hook through init_config_globals/ap_init_vhost_config.
>
> ap_run_pre_config(): Uses wrong hook order.
>
> ap_process_config_tree()
> ap_fixup_virtual_hosts()
> ap_fini_vhost_config()
>
> apr_hook_sort_all(): This is too late.
>
>
> I think apr_hook_sort_all() should be called right after
> ap_read_config() before ap_run_pre_config(). Is it really that simple
> or am I missing something?
I guess the question is if we clean up the hook list after ap_run_pre_config()
and call the modules register_hooks function again somewhere in
ap_process_config_tree()
ap_fixup_virtual_hosts()
ap_fini_vhost_config()
If yes I guess we need to copy the sort call up otherwise a move seems to be ok.
Regards
RĂ¼diger