From c07f3d3ff693025fc90a72e9c9947bfd457da11e Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 20 Sep 2021 09:01:08 +0300 Subject: Fixed WebSocket connection hang issue after listener reconfigure. Because the configuration values were read from the listener's configuration, an established WebSocket connection was unable to work properly (i. e. stuck) if the listener was removed. The correct source of configuration values is the request config joint. This is related to issue #581 on GitHub. --- test/test_asgi_websockets.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/test_asgi_websockets.py b/test/test_asgi_websockets.py index 140bcb9a..7da2d9ce 100644 --- a/test/test_asgi_websockets.py +++ b/test/test_asgi_websockets.py @@ -1481,3 +1481,20 @@ class TestASGIWebsockets(TestApplicationPython): self.check_frame(frame, True, self.ws.OP_PING, '') # PING frame sock.close() + + def test_asgi_websockets_client_locks_app(self): + self.load('websockets/mirror') + + message = 'blah' + + _, sock, _ = self.ws.upgrade() + + assert 'success' in self.conf({}), 'remove app' + + self.ws.frame_write(sock, self.ws.OP_TEXT, message) + + frame = self.ws.frame_read(sock) + + assert message == frame['data'].decode('utf-8'), 'client' + + sock.close() -- cgit