From f0bb8f043bc3bf82b0822dd5d3b985e1e33ff4a4 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Wed, 25 May 2022 16:33:14 +1000 Subject: Increment version to 4.9.2 and add release notes file. --- docs/release-notes.rst | 1 + docs/release-notes/version-4.9.2.rst | 11 +++++++++++ src/server/wsgi_version.h | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 docs/release-notes/version-4.9.2.rst 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..ff57683 --- /dev/null +++ b/docs/release-notes/version-4.9.2.rst @@ -0,0 +1,11 @@ +============= +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 +---------- + 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" /* ------------------------------------------------------------------------- */ -- cgit v1.2.1 From e82960b358c4697a100cf925d6819d437a1cf615 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Wed, 25 May 2022 16:33:41 +1000 Subject: Fix argument passing for reload function. --- src/server/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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): -- cgit v1.2.1 From b88a94ad80771522f85f78909131cc78fea36993 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Wed, 25 May 2022 16:36:12 +1000 Subject: Fix bug where daemon mode process could crash if invalid URL path was used. --- docs/release-notes/version-4.9.2.rst | 3 +++ src/server/mod_wsgi.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/release-notes/version-4.9.2.rst b/docs/release-notes/version-4.9.2.rst index ff57683..2701dab 100644 --- a/docs/release-notes/version-4.9.2.rst +++ b/docs/release-notes/version-4.9.2.rst @@ -9,3 +9,6 @@ Version 4.9.2 of mod_wsgi can be obtained from: 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/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); -- cgit v1.2.1 From a8874832f3f08e6b12ae83eae6db6406fd3ddaff Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Wed, 25 May 2022 16:41:25 +1000 Subject: Try updating ubuntu version to fix system package installation issues. --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c38e733..1999eb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: jobs: build: name: "Build mod_wsgi packages" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" steps: - uses: "actions/checkout@v2" - uses: "actions/setup-python@v2" @@ -28,7 +28,7 @@ jobs: tests: name: "Test mod_wsgi package (Python ${{ matrix.python-version }})" - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" needs: - build strategy: -- cgit v1.2.1 From c56635d6d3eff320d17297b4c971723509c32402 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Wed, 25 May 2022 16:55:02 +1000 Subject: Revert ubuntu version and try updating package repo details. --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1999eb8..5c9534c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,14 @@ on: jobs: build: name: "Build mod_wsgi packages" - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-20.04" steps: - uses: "actions/checkout@v2" - 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" @@ -28,7 +30,7 @@ jobs: tests: name: "Test mod_wsgi package (Python ${{ matrix.python-version }})" - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-20.04" needs: - build strategy: -- cgit v1.2.1 From befcf529d0cdcc5268190634804af653d9fe6405 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Wed, 25 May 2022 16:57:15 +1000 Subject: Update package repo details for matrix builds as well. --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c9534c..1e7adbb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,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" -- cgit v1.2.1