Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Add an ``asyncore_loop_timeout`` adjustment value, which controls the

  ``timeout`` value passed to ``asyncore.loop``; defaults to 1.

- The default asyncore loop timeout is now 1 second.  This prevents slow
  shutdown on Windows.  See #6 .  This
  shouldn't matter to anyone in particular, but it can be changed via the
  ``asyncore_loop_timeout`` adjustment (it used to previously default to 30
  seconds).

Closes #6.
  • Loading branch information...
commit 47d1ff8f4eda4cef6f4d98600db96effaaa4013a 1 parent d4ca0df
Chris McDonough mcdonc authored
21 CHANGES.txt
View
@@ -1,3 +1,24 @@
+Next release
+------------
+
+Features
+~~~~~~~~
+
+- Add an ``asyncore_loop_timeout`` adjustment value, which controls the
+ ``timeout`` value passed to ``asyncore.loop``; defaults to 1.
+
+Bug Fixes
+~~~~~~~~~
+
+- The default asyncore loop timeout is now 1 second. This prevents slow
+ shutdown on Windows. See https://github.com/Pylons/waitress/issues/6 . This
+ shouldn't matter to anyone in particular, but it can be changed via the
+ ``asyncore_loop_timeout`` adjustment (it used to previously default to 30
+ seconds).
+
+- Don't complain if there's a response to a HEAD request that contains a
+ Content-Length > 0. See https://github.com/Pylons/waitress/pull/7.
+
0.8.2 (2012-11-14)
------------------
4 docs/arguments.rst
View
@@ -91,3 +91,7 @@ expose_tracebacks
Boolean: expose tracebacks of unhandled exceptions to client. Default:
``False``.
+asyncore_loop_timeout
+ The ``timeout`` value (seconds) passed to ``asyncore.loop`` to run the
+ mainloop. Default: 1. (New in 0.8.3.)
+
5 waitress/adjustments.py
View
@@ -98,6 +98,9 @@ class Adjustments(object):
(socket.SOL_TCP, socket.TCP_NODELAY, 1),
]
+ # The asyncore.loop timeout value
+ asyncore_loop_timeout = 1
+
def __init__(self, **kw):
for k, v in kw.items():
if k == 'host':
@@ -134,6 +137,8 @@ def __init__(self, **kw):
v = asbool(v)
elif k == 'ident':
v = str(v)
+ elif k == 'asyncore_loop_timeout':
+ v = int(v)
else:
raise ValueError('Unknown adjustment %r' % k)
setattr(self, k, v)
5 waitress/server.py
View
@@ -126,7 +126,10 @@ def handle_accept(self):
def run(self):
try:
- self.asyncore.loop(map=self._map)
+ self.asyncore.loop(
+ timeout=self.adj.asyncore_loop_timeout,
+ map=self._map
+ )
except (SystemExit, KeyboardInterrupt):
self.task_dispatcher.shutdown()
3  waitress/tests/test_adjustments.py
View
@@ -50,7 +50,7 @@ def test_goodvars(self):
connection_limit='1000', cleanup_interval='1100',
channel_timeout='1200', log_socket_errors='true',
max_request_header_size='1300', max_request_body_size='1400',
- expose_tracebacks='true', ident='abc')
+ expose_tracebacks='true', ident='abc', asyncore_loop_timeout='5')
self.assertEqual(inst.host, 'host')
self.assertEqual(inst.port, 8080)
self.assertEqual(inst.threads, 5)
@@ -67,6 +67,7 @@ def test_goodvars(self):
self.assertEqual(inst.max_request_header_size, 1300)
self.assertEqual(inst.max_request_body_size, 1400)
self.assertEqual(inst.expose_tracebacks, True)
+ self.assertEqual(inst.asyncore_loop_timeout, 5)
self.assertEqual(inst.ident, 'abc')
def test_badvar(self):
2  waitress/tests/test_server.py
View
@@ -235,7 +235,7 @@ class DummyAdj:
channel_timeout= 300
class DummyAsyncore(object):
- def loop(self, map):
+ def loop(self, timeout=None, map=None):
raise SystemExit
class DummyTrigger(object):
Please sign in to comment.
Something went wrong with that request. Please try again.