[IMP] bus: mini typo in websocket protocol

Well it is not a typo but a mini code improvement. The suggested diff
clarifies the intent of `_handle_control_frame` with regards to
`_get_messages`. Because it was `return self._handle...` we had to read
the method to determine if it was returning something in order to know
whether the message would be propagated to the rest of the websocket
routing by `_get_message`. Now it is clear that the control frames are
handled right away and that they are not propagated to the business.

closes odoo/odoo#110834

Signed-off-by: Julien Castiaux <juc@odoo.com>
This commit is contained in:
Julien Castiaux
2023-01-24 21:10:55 +01:00
parent 9d870e2259
commit b41ebc4b72
+2 -1
View File
@@ -414,7 +414,8 @@ class Websocket:
"""
frame = self._get_next_frame()
if frame.opcode in CTRL_OP:
return self._handle_control_frame(frame)
self._handle_control_frame(frame)
return
if self.state is not ConnectionState.OPEN:
# After receiving a control frame indicating the connection
# should be closed, a peer discards any further data