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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user