diff options
-rw-r--r-- | kvmd/apps/vnc/rfb/__init__.py | 2 | ||||
-rw-r--r-- | kvmd/apps/vnc/server.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py index 77f29422..42b762c2 100644 --- a/kvmd/apps/vnc/rfb/__init__.py +++ b/kvmd/apps/vnc/rfb/__init__.py @@ -77,8 +77,6 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute self.__rfb_version = 0 self._encodings = RfbClientEncodings(frozenset()) - self._lock = asyncio.Lock() - get_logger(0).info("Connected client: %s", self._remote) # ===== diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py index 36be7944..64fb1178 100644 --- a/kvmd/apps/vnc/server.py +++ b/kvmd/apps/vnc/server.py @@ -108,6 +108,8 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes self.__mouse_buttons: Dict[str, Optional[bool]] = {"left": None, "right": None, "middle": None} self.__mouse_move = {"x": -1, "y": -1} + self._lock = asyncio.Lock() + # ===== async def run(self) -> None: @@ -277,7 +279,8 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes await self.__kvmd.set_streamer_params(user, passwd, self._encodings.tight_jpeg_quality, self.__desired_fps) async def _on_fb_update_request(self) -> None: - self.__fb_requested = True + async with self._lock: + self.__fb_requested = True # ===== |