update to 4.9.1

This commit is contained in:
penelope 2022-05-17 20:48:12 +08:00
parent 4a0a77cfb9
commit bea2551e8b
5 changed files with 7 additions and 102 deletions

BIN
4.9.1.tar.gz Normal file

Binary file not shown.

View File

@ -1,41 +0,0 @@
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);

View File

@ -1,55 +0,0 @@
From b03b02df6318afe26052db5b0365732152cacea2 Mon Sep 17 00:00:00 2001
From: Graham Dumpleton <Graham.Dumpleton@gmail.com>
Date: Tue, 14 May 2019 16:14:42 +1000
Subject: [PATCH] Use official APIs for accessing interpreter list.
---
src/server/wsgi_interp.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/server/wsgi_interp.c b/src/server/wsgi_interp.c
index 4a948509..3fbca04b 100644
--- a/src/server/wsgi_interp.c
+++ b/src/server/wsgi_interp.c
@@ -338,9 +338,10 @@ static PyObject *ShutdownInterpreter_call(
PyThreadState_Swap(NULL);
- tstate = tstate->interp->tstate_head;
+ tstate = PyInterpreterState_ThreadHead(tstate->interp);
+
while (tstate) {
- tstate_next = tstate->next;
+ tstate_next = PyThreadState_Next(tstate);
if (tstate != tstate_save) {
PyThreadState_Swap(tstate);
PyThreadState_Clear(tstate);
@@ -436,9 +437,13 @@ InterpreterObject *newInterpreterObject(const char *name)
*/
if (!name) {
+#if PY_MAJOR_VERSION > 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7)
+ interp = PyInterpreterState_Main();
+#else
interp = PyInterpreterState_Head();
- while (interp->next)
- interp = interp->next;
+ while (PyInterpreterState_Next(interp))
+ interp = PyInterpreterState_Next(interp);
+#endif
name = "";
}
@@ -1883,9 +1888,10 @@ static void Interpreter_dealloc(InterpreterObject *self)
PyThreadState_Swap(NULL);
- tstate = tstate->interp->tstate_head;
+ tstate = PyInterpreterState_ThreadHead(tstate->interp);
+
while (tstate) {
- tstate_next = tstate->next;
+ tstate_next = PyThreadState_Next(tstate);
if (tstate != tstate_save) {
PyThreadState_Swap(tstate);
PyThreadState_Clear(tstate);

Binary file not shown.

View File

@ -5,17 +5,15 @@
%{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}}
%global sphinxbin %{_bindir}/sphinx-build-3
Name: mod_wsgi
Version: 4.6.4
Release: 2
Version: 4.9.1
Release: 1
Summary: A WSGI interface for Python web applications in Apache
License: ASL 2.0
URL: https://modwsgi.readthedocs.io/
Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/%{version}.tar.gz#/mod_wsgi-%{version}.tar.gz
Source0: https://github.com/GrahamDumpleton/mod_wsgi/archive/refs/tags/%{version}.tar.gz
Source1: wsgi-python3.conf
Patch1: mod_wsgi-4.5.20-exports.patch
Patch2: Use-official-APIs-for-accessing-interpreter-list.patch
Patch3: Changed-functions-to-pre-post-actions-when-forking.patch
BuildRequires: httpd-devel gcc
BuildRequires: httpd-devel gcc perl
%{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$}
%{?filter_setup}
%description
@ -76,6 +74,9 @@ popd
%{_bindir}/mod_wsgi-express-3
%changelog
* Tue May 17 2022 yangping <yangping69@h-partners> - 4.9.1-1
- Update to 4.9.1
* Sat Feb 27 2021 zhaorenhai <zhaorenhai@hotmail.com> - 4.6.4-2
- Add configure file