mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Fix extra close frame being sent during shutdown
This commit is contained in:
parent
9e4e8985f0
commit
724354ff47
1 changed files with 1 additions and 1 deletions
|
|
@ -414,7 +414,7 @@ def close(self):
|
|||
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…
Reference in a new issue