mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix extra close frame being sent during shutdown
This commit is contained in:
parent
9e4e8985f0
commit
724354ff47
@ -414,7 +414,7 @@ class WebSocketConnection(HTTPConnection):
|
||||
self.log.exception('Error in WebSocket close handler')
|
||||
# Try to write a close frame, just once
|
||||
try:
|
||||
if self.send_buf is None:
|
||||
if self.send_buf is None and not self.ws_close_sent:
|
||||
self.websocket_close(SHUTTING_DOWN, 'Shutting down')
|
||||
with self.cf_lock:
|
||||
self.write(self.control_frames.pop())
|
||||
|
Loading…
x
Reference in New Issue
Block a user