summaryrefslogtreecommitdiff
path: root/src/waitress/task.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/waitress/task.py')
-rw-r--r--src/waitress/task.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/waitress/task.py b/src/waitress/task.py
index 3a7cf17..2ac8f4c 100644
--- a/src/waitress/task.py
+++ b/src/waitress/task.py
@@ -560,6 +560,11 @@ class WSGITask(Task):
if mykey not in environ:
environ[mykey] = value
+ # Insert a callable into the environment that allows the application to
+ # check if the client disconnected. Only works with
+ # channel_request_lookahead larger than 0.
+ environ["waitress.client_disconnected"] = self.channel.check_client_disconnected
+
# cache the environ for this request
self.environ = environ
return environ