Skip to content

Commit ad79721

Browse files
committed
Don't log when connection drops during handshake.
Fix #1237. Refs #984.
1 parent 580c417 commit ad79721

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/websockets/legacy/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@ async def handshake(
598598

599599
# The connection may drop while process_request is running.
600600
if self.state is State.CLOSED:
601-
raise self.connection_closed_exc() # pragma: no cover
601+
# This subclass of ConnectionError is silently ignored in handler().
602+
raise BrokenPipeError("connection closed during opening handshake")
602603

603604
# Change the response to a 503 error if the server is shutting down.
604605
if not self.ws_server.is_serving():

0 commit comments

Comments
 (0)