1 Star 0 Fork 0

OpenPackage/mod_wsgi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Changed-functions-to-pre-post-actions-when-forking.patch 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
王玺源 提交于 2021-08-11 11:12 +08:00 . Init
From 0f34844009075391c55419a3afb90e469facf35e Mon Sep 17 00:00:00 2001
From: Graham Dumpleton <Graham.Dumpleton@gmail.com>
Date: Tue, 14 May 2019 16:14:07 +1000
Subject: [PATCH] Changed functions to pre/post actions when forking.
---
src/server/mod_wsgi.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c
index 2e4bb24d..bf55945a 100644
--- a/src/server/mod_wsgi.c
+++ b/src/server/mod_wsgi.c
@@ -4345,8 +4345,13 @@ static void wsgi_python_child_init(apr_pool_t *p)
* do it if Python was initialised in parent process.
*/
- if (wsgi_python_initialized && !wsgi_python_after_fork)
+ if (wsgi_python_initialized && !wsgi_python_after_fork) {
+#if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7)
+ PyOS_AfterFork_Child();
+#else
PyOS_AfterFork();
+#endif
+ }
/* Finalise any Python objects required by child process. */
@@ -10422,6 +10427,12 @@ static int wsgi_start_process(apr_pool_t *p, WSGIDaemonProcess *daemon)
wsgi_exit_daemon_process(0);
}
+ if (wsgi_python_initialized) {
+#if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7)
+ PyOS_AfterFork_Parent();
+#endif
+ }
+
apr_pool_note_subprocess(p, &daemon->process, APR_KILL_AFTER_TIMEOUT);
apr_proc_other_child_register(&daemon->process, wsgi_manage_process,
daemon, NULL, p);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openpackage/mod_wsgi.git
git@gitee.com:openpackage/mod_wsgi.git
openpackage
mod_wsgi
mod_wsgi
master

搜索帮助