diff options
author | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2019-10-06 09:58:30 +1100 |
---|---|---|
committer | Graham Dumpleton <Graham.Dumpleton@gmail.com> | 2019-10-06 09:58:30 +1100 |
commit | 217e80b7436035723b80ff02ee349365e8553dfc (patch) | |
tree | 60b65f902f70a3830e6380ed6f37e59d360f66e9 | |
parent | 43dd2bc822ee16e73d728dd895046cc99cf0b480 (diff) | |
parent | f953105fb5f6d4550180d677bd623b1fd6834679 (diff) | |
download | mod_wsgi-4.6.8.tar.gz |
Merge branch 'release/4.6.8'4.6.8
-rw-r--r-- | docs/release-notes.rst | 1 | ||||
-rw-r--r-- | docs/release-notes/version-4.6.8.rst | 21 | ||||
-rw-r--r-- | src/server/__init__.py | 27 | ||||
-rw-r--r-- | src/server/mod_wsgi.c | 1 | ||||
-rwxr-xr-x | src/server/wsgi_version.h | 4 |
5 files changed, 47 insertions, 7 deletions
diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 09c8b5b..22cf506 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -5,6 +5,7 @@ Release Notes .. toctree:: :maxdepth: 2 + release-notes/version-4.6.8 release-notes/version-4.6.7 release-notes/version-4.6.6 release-notes/version-4.6.5 diff --git a/docs/release-notes/version-4.6.8.rst b/docs/release-notes/version-4.6.8.rst new file mode 100644 index 0000000..909c3fc --- /dev/null +++ b/docs/release-notes/version-4.6.8.rst @@ -0,0 +1,21 @@ +============= +Version 4.6.8 +============= + +Version 4.6.8 of mod_wsgi can be obtained from: + + https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.6.8 + +Bugs Fixed +---------- + +* When the queue timeout was triggered for requests sent to daemon mode + processes, the error response wasn't being flushed out correctly resulting + in the connection still being held up to the time of the socket timeout. + +New Features +------------ + +* Add ``--enable-sendfile`` option to ``mod_wsgi-express``. Should only be + used where the operating system kernel supports ``sendfile()`` for the + file system type where files are hosted. diff --git a/src/server/__init__.py b/src/server/__init__.py index 0decea3..6b4a82e 100644 --- a/src/server/__init__.py +++ b/src/server/__init__.py @@ -9,7 +9,7 @@ import math import signal import threading import atexit -import imp +import types import re import pprint import time @@ -30,12 +30,15 @@ _py_soext = '.so' _py_dylib = '' try: - import imp import sysconfig import distutils.sysconfig _py_soabi = sysconfig.get_config_var('SOABI') - _py_soext = sysconfig.get_config_var('SO') + + _py_soext = sysconfig.get_config_var('EXT_SUFFIX') + + if _py_soext is None: + _py_soext = sysconfig.get_config_var('SO') if (sysconfig.get_config_var('WITH_DYLD') and sysconfig.get_config_var('LIBDIR') and @@ -436,6 +439,11 @@ KeepAliveTimeout %(keep_alive_timeout)s KeepAlive Off </IfDefine> +<IfDefine MOD_WSGI_ENABLE_SENDFILE> +EnableSendfile On +WSGIEnableSendfile On +</IfDefine> + <IfDefine MOD_WSGI_COMPRESS_RESPONSES> AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html @@ -1407,7 +1415,7 @@ class ApplicationHandler(object): self.target = entry_point elif application_type != 'static': - self.module = imp.new_module('__wsgi__') + self.module = types.ModuleType('__wsgi__') self.module.__file__ = entry_point with open(entry_point, 'r') as fp: @@ -1516,7 +1524,7 @@ class ResourceHandler(object): for extension, script in resources: extension_name = re.sub(r'[^\w]{1}', '_', extension) module_name = '__wsgi_resource%s__' % extension_name - module = imp.new_module(module_name) + module = types.ModuleType(module_name) module.__file__ = script with open(script, 'r') as fp: @@ -2213,6 +2221,12 @@ option_list = ( 'being forcibly flushed. Defaults to 0 seconds indicating that ' 'it will default to the value of the \'socket-timeout\' option.'), + optparse.make_option('--enable-sendfile', action='store_true', + default=False, help='Flag indicating whether sendfile() support ' + 'should be enabled. Defaults to being disabled. This should ' + 'only be enabled if the operating system kernel and file system ' + 'type where files are hosted supports it.'), + optparse.make_option('--reload-on-changes', action='store_true', default=False, help='Flag indicating whether worker processes ' 'should be automatically restarted when any Python code file ' @@ -3238,6 +3252,9 @@ def _cmd_setup_server(command, args, options): if options['application_type'] == 'static': options['httpd_arguments_list'].append('-DMOD_WSGI_STATIC_ONLY') + if options['enable_sendfile']: + options['httpd_arguments_list'].append('-DMOD_WSGI_ENABLE_SENDFILE') + if options['server_metrics']: options['httpd_arguments_list'].append('-DMOD_WSGI_SERVER_METRICS') if options['server_status']: diff --git a/src/server/mod_wsgi.c b/src/server/mod_wsgi.c index c9e20a0..a2b6153 100644 --- a/src/server/mod_wsgi.c +++ b/src/server/mod_wsgi.c @@ -13148,6 +13148,7 @@ static int wsgi_hook_daemon_handler(conn_rec *c) if (queue_time > wsgi_daemon_process->group->queue_timeout) { queue_timeout_occurred = 1; + r->status = HTTP_INTERNAL_SERVER_ERROR; r->status_line = "200 Timeout"; ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, diff --git a/src/server/wsgi_version.h b/src/server/wsgi_version.h index e1f6379..5fac22f 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 6 -#define MOD_WSGI_MICROVERSION_NUMBER 7 -#define MOD_WSGI_VERSION_STRING "4.6.7" +#define MOD_WSGI_MICROVERSION_NUMBER 8 +#define MOD_WSGI_VERSION_STRING "4.6.8" /* ------------------------------------------------------------------------- */ |