summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2021-09-20 09:01:08 +0300
committerMax Romanov <max.romanov@nginx.com>2021-09-20 09:01:08 +0300
commitc07f3d3ff693025fc90a72e9c9947bfd457da11e (patch)
treefb055563860e40a5b2d94bad57932f6e86e0d8a0 /test
parentd21ebcce833ff10dd1e199a75d523f81b5549b6d (diff)
downloadunit-c07f3d3ff693025fc90a72e9c9947bfd457da11e.tar.gz
unit-c07f3d3ff693025fc90a72e9c9947bfd457da11e.tar.bz2
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.
Diffstat (limited to '')
-rw-r--r--test/test_asgi_websockets.py17
1 files changed, 17 insertions, 0 deletions
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()