gpt4 book ai didi

c - 有没有办法确定apache模块的加载顺序

转载 作者:太空宇宙 更新时间:2023-11-04 04:02:19 26 4
gpt4 key购买 nike

我正在开发一个基于 Apache 的应用程序,只有很少的自定义模块。

我想与其他人共享一个模块中的某些功能。我需要在 stratup 阶段将它们连接在一起。我想使用带有模块名称的 GetModuleHandle + GetProcAddress(它将仅在 Windows 下运行)——但这只有在模块已经被 Apache 服务器加载时才会成功。

有没有办法配置 Apache 模块的加载顺序。我只需要控制我的模块——其他的无关紧要。

提前致谢。

最佳答案

如果您尝试从模块源控制 Apache Hook 调用顺序,您可以尝试使用 APR_HOOK_FIRSTAPR_HOOK_MIDDLEAPR_HOOK_LAST。或者您可以专门命名其他模块以强制执行排序约束。来自docs :

... "There are two mechanisms for doing this. The first, rather crude, method, allows us to specify roughly where the hook is run relative to other modules. The final argument control this. There are three possible values: APR_HOOK_FIRST, APR_HOOK_MIDDLE and APR_HOOK_LAST.

"All modules using any particular value may be run in any order relative to each other, but, of course, all modules using APR_HOOK_FIRST will be run before APR_HOOK_MIDDLE which are before APR_HOOK_LAST. Modules that don't care when they are run should use APR_HOOK_MIDDLE. These values are spaced out, so that positions like APR_HOOK_FIRST-2 are possible to hook slightly earlier than other functions. ...

"The other method allows finer control. When a module knows that it must be run before (or after) some other modules, it can specify them by name. The second (third) argument is a NULL-terminated array of strings consisting of the names of modules that must be run before (after) the current module. For example, suppose we want "mod_xyz.c" and "mod_abc.c" to run before we do, then we'd hook as follows ..." [example follows]

关于c - 有没有办法确定apache模块的加载顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10300220/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com