Delphi XE 中 Apache 方法 apr_pool_create_ex 的正确用法是什么?
我以前创建过 Apache 模块,但都是处理程序。现在我正在开发一个服务提供者。已经创建了一个骨架模块,Apache 正在调用我的 child_init 回调方法。在 child_init 方法中,我成功调用了 ap_pool_create_ex*(返回 APR_SUCCESS),但是在离开 child_it 调用后,我在第三个或第四个工作线程的(httpd.exe)生成期间收到访问冲突(第三个在事件中显示日志)。
procedure provider_child_init(pchild: Papr_pool_t; s: Pserver_rec); cdecl;
var
rv : apr_status_t;
mypool : Papr_pool_t;
begin
rv := -1;
rv := apr_pool_create_ex(@mypool,pchild,nil,nil);
end;
AV 消息是:
“项目 C:\Apache2.2\bin\http.exe 引发了太多连续异常:'在 0x00000000 处的访问冲突:读取地址 0x00000000'。进程停止。使用 Step 或 Run 继续”</p>
事件簿:
…
Thread Start: Thread ID: 5652. Process httpd.exe (4212)
Thread Start: Thread ID: 5132. Process httpd.exe (4212)
Thread Start: Thread ID: 5988. Process httpd.exe (4212)
注意: AV 出现在线程 ID 5988 和 4212 中是父 httpd.exe 进程。
- Windows“libapr-1.dll”不包含“apr_pool_create”,这就是我使用“_ex”版本的原因。知道为什么缺少 apr_pool_create 吗?我看到 apr_pool_create 正在其他成功的模块中使用,尽管它们是用“C”编写的。
操作系统:Windows 7 企业版 64 位
阿帕奇:2.2.17.0
IDE:德尔福 XE