summaryrefslogtreecommitdiff
path: root/waitress/channel.py
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2019-03-28 20:21:37 -0500
committerMichael Merickel <michael@merickel.org>2019-03-28 21:00:39 -0500
commit8eb6507a59621f48462c05fbc5e855748992764b (patch)
tree2faf44e71878239eb9a756bc7fa110e93361e417 /waitress/channel.py
parent47942f829edff2b1d608cd2d1ec46b2fbc37955f (diff)
downloadwaitress-error-task-disconnect.tar.gz
handle client disconnections while rendering error responseerror-task-disconnect
Diffstat (limited to 'waitress/channel.py')
-rw-r--r--waitress/channel.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/waitress/channel.py b/waitress/channel.py
index 6b80919..a377a54 100644
--- a/waitress/channel.py
+++ b/waitress/channel.py
@@ -374,7 +374,10 @@ class HTTPChannel(wasyncore.dispatcher, object):
except KeyError:
pass
task = self.error_task_class(self, request)
- task.service() # must not fail
+ try:
+ task.service() # must not fail
+ except ClientDisconnected:
+ task.close_on_finish = True
else:
task.close_on_finish = True
# we cannot allow self.requests to drop to empty til