summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-04-25 15:41:12 +0300
committerDevaev Maxim <[email protected]>2020-04-25 15:41:12 +0300
commit775f8741a067b46c0577ab1108981c35a488f693 (patch)
treebdf4805fb20ec2493f9f25c89f7d801c52418298 /kvmd
parent6a5e3e47bb19a3283546e2fc797b45f5765a4e30 (diff)
fb_requested on lock
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/apps/vnc/rfb/__init__.py2
-rw-r--r--kvmd/apps/vnc/server.py5
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
# =====