Skip to content

Commit

Permalink
Merge branch 'release/4.6.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Oct 5, 2019
2 parents 43dd2bc + f953105 commit 217e80b
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/release-notes.rst
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions 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.
27 changes: 22 additions & 5 deletions src/server/__init__.py
Expand Up @@ -9,7 +9,7 @@
import signal
import threading
import atexit
import imp
import types
import re
import pprint
import time
Expand All @@ -30,12 +30,15 @@
_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
Expand Down Expand Up @@ -436,6 +439,11 @@ def find_mimetypes():
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
Expand Down Expand Up @@ -1407,7 +1415,7 @@ def __init__(self, entry_point, application_type='script',
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:
Expand Down Expand Up @@ -1516,7 +1524,7 @@ def __init__(self, resources):
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:
Expand Down Expand Up @@ -2213,6 +2221,12 @@ def check_percentage(option, opt_str, value, parser):
'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 '
Expand Down Expand Up @@ -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']:
Expand Down
1 change: 1 addition & 0 deletions src/server/mod_wsgi.c
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/server/wsgi_version.h
Expand Up @@ -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"

/* ------------------------------------------------------------------------- */

Expand Down

0 comments on commit 217e80b

Please sign in to comment.