summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Dumpleton <Graham.Dumpleton@gmail.com>2022-05-31 10:45:32 +1000
committerGraham Dumpleton <Graham.Dumpleton@gmail.com>2022-05-31 10:45:32 +1000
commite98650f3b4e468aaaf76c77f77faf6933d571e2f (patch)
tree2da4f3deeb0a417b529650122795cf29f636309d
parent0497f0c29e8dd06608378e6fc814a6037e8c6906 (diff)
parentbefcf529d0cdcc5268190634804af653d9fe6405 (diff)
downloadmod_wsgi-e98650f3b4e468aaaf76c77f77faf6933d571e2f.tar.gz
Merge branch 'release/4.9.2'4.9.2
-rw-r--r--.github/workflows/main.yml4
-rw-r--r--docs/release-notes.rst1
-rw-r--r--docs/release-notes/version-4.9.2.rst14
-rw-r--r--src/server/__init__.py4
-rw-r--r--src/server/mod_wsgi.c11
-rwxr-xr-xsrc/server/wsgi_version.h4
6 files changed, 34 insertions, 4 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c38e733..1e7adbb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -16,6 +16,8 @@ jobs:
- uses: "actions/setup-python@v2"
with:
python-version: "3.9"
+ - name: "Update package details"
+ run: sudo apt --fix-missing update
- name: "Install Apache package"
run: sudo apt install -y apache2-dev
- name: "Build mod_wsgi packages"
@@ -45,6 +47,8 @@ jobs:
with:
name: dist
path: dist
+ - name: "Update package details"
+ run: sudo apt --fix-missing update
- name: "Install Apache package"
run: sudo apt install -y apache2-dev
- name: "Update pip installation"
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index fa6d30c..b7612bf 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -5,6 +5,7 @@ Release Notes
.. toctree::
:maxdepth: 2
+ release-notes/version-4.9.2
release-notes/version-4.9.1
release-notes/version-4.9.0
diff --git a/docs/release-notes/version-4.9.2.rst b/docs/release-notes/version-4.9.2.rst
new file mode 100644
index 0000000..2701dab
--- /dev/null
+++ b/docs/release-notes/version-4.9.2.rst
@@ -0,0 +1,14 @@
+=============
+Version 4.9.2
+=============
+
+Version 4.9.2 of mod_wsgi can be obtained from:
+
+ https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.9.2
+
+Bugs Fixed
+----------
+
+* When using ``mod_wsgi-express`` in daemon mode, and source code reloading
+ was enabled, an invalid URL path which contained a byte sequence which
+ could not be decoded as UTF-8 was causing a process crash.
diff --git a/src/server/__init__.py b/src/server/__init__.py
index fc632cf..33f0fad 100644
--- a/src/server/__init__.py
+++ b/src/server/__init__.py
@@ -1520,7 +1520,7 @@ class ApplicationHandler(object):
def setup_recorder(self, savedir):
self.application = RequestRecorder(self.application, savedir)
- def reload_required(self, environ):
+ def reload_required(self, resource):
if self.debug_mode:
return False
@@ -1596,7 +1596,7 @@ class ResourceHandler(object):
extension = self.resource_extension(resource)
function = getattr(self.resources[extension], 'reload_required', None)
if function is not None:
- return function(environ)
+ return function(resource)
return False
def handle_request(self, environ, start_response):
diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c
index 59aad90..0123472 100644
--- a/src/server/mod_wsgi.c
+++ b/src/server/mod_wsgi.c
@@ -3852,9 +3852,20 @@ static int wsgi_reload_required(apr_pool_t *pool, request_rec *r,
if (object) {
PyObject *args = NULL;
PyObject *result = NULL;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *path = NULL;
+#endif
Py_INCREF(object);
+#if PY_MAJOR_VERSION >= 3
+ path = PyUnicode_Decode(resource, strlen(resource),
+ Py_FileSystemDefaultEncoding,
+ "surrogateescape");
+ args = Py_BuildValue("(O)", path);
+ Py_DECREF(path);
+#else
args = Py_BuildValue("(s)", resource);
+#endif
result = PyObject_CallObject(object, args);
Py_DECREF(args);
Py_DECREF(object);
diff --git a/src/server/wsgi_version.h b/src/server/wsgi_version.h
index 793ee81..ed8a946 100755
--- a/src/server/wsgi_version.h
+++ b/src/server/wsgi_version.h
@@ -25,8 +25,8 @@
#define MOD_WSGI_MAJORVERSION_NUMBER 4
#define MOD_WSGI_MINORVERSION_NUMBER 9
-#define MOD_WSGI_MICROVERSION_NUMBER 1
-#define MOD_WSGI_VERSION_STRING "4.9.1"
+#define MOD_WSGI_MICROVERSION_NUMBER 2
+#define MOD_WSGI_VERSION_STRING "4.9.2"
/* ------------------------------------------------------------------------- */