Skip to content

Commit

Permalink
fix: eventlet.websocket not always used from eventlet.wsgi (fixes #946)…
Browse files Browse the repository at this point in the history
… (#949)

Co-authored-by: Hervé Beraud <hberaud@redhat.com>
  • Loading branch information
dhdaines and 4383 committed Mar 29, 2024
1 parent 80f3936 commit c0cb04d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions eventlet/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ def __call__(self, environ, start_response):
[('Connection', 'close'), ] + headers)
return [body]

# We're ready to switch protocols; flag the connection
# as idle to play well with a graceful stop
environ['eventlet.set_idle']()

# We're ready to switch protocols; if running under Eventlet
# (this is not always the case) then flag the connection as
# idle to play well with a graceful stop
if 'eventlet.set_idle' in environ:
environ['eventlet.set_idle']()
try:
self.handler(ws)
except OSError as e:
Expand Down

0 comments on commit c0cb04d

Please sign in to comment.