Skip to content

Initial VNC Fence implementation - #323

Open
TeofilisMartisius wants to merge 1 commit into
sibson:mainfrom
TeofilisMartisius:main
Open

Initial VNC Fence implementation#323
TeofilisMartisius wants to merge 1 commit into
sibson:mainfrom
TeofilisMartisius:main

Conversation

@TeofilisMartisius

@TeofilisMartisius TeofilisMartisius commented May 15, 2026

Copy link
Copy Markdown

Add basic ServerFence/ClientFence implementation, which is required to work with shared tigervnc #322

@pmhahn pmhahn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay from reading the code/PR.
I would find it clearer to add a class FencFlags(IntFlag), which improves type safety and debugging and future additions to implement Fence for real.

I've no yet run any tests.

Comment thread vncdotool/rfb.py Outdated
Comment thread vncdotool/rfb.py Outdated
Comment thread vncdotool/rfb.py Outdated
@pmhahn pmhahn added the feature label Jun 11, 2026
Comment thread vncdotool/rfb.py
@coder111111

Copy link
Copy Markdown

Hi, thanks for your comments, I'll try to fix this as soon as I have some time.

@pmhahn

pmhahn commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Functional test is failing: make test-func – more exactly: all 3 tests from tests/functional/test_proxy.py.

For debugging: PATH=$PATH:.vncdo/libvncserver-LibVNCServer-0.9.14/examples python3 -m unittest discover -s tests/functional -t . -p test_proxy.py -k test_key_alpha -v

If I remember correctly vncdotool/loggingproxy.py functions as a pass-through proxy, e.g. all traffic between any client and server goes completely through it. As such it also must be able to understand/parse the new fence messages completely – handle the variable length payload – to pass the message from server-to-client and client-to-server.

I've lost most of my knowledge about this project in the last 2 years, so maybe @sibson can help and knows, where the proxy must be extended.

@pmhahn

pmhahn commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Functional test is failing: make test-func – more exactly: all 3 tests from tests/functional/test_proxy.py.

diff --git a/vncdotool/loggingproxy.py b/vncdotool/loggingproxy.py
index 37b0177..c51ec7d 100644
--- a/vncdotool/loggingproxy.py
+++ b/vncdotool/loggingproxy.py
@@ -171,6 +171,8 @@ class RFBServer(Protocol):  # type: ignore[misc]
             else:
                 log.debug("Unhandled subtype %r", QemuClientMessage.lookup(subtype))
                 raise ProtocolError(subtype)
+        elif ptype == MsgC2S.CLIENT_FENCE:
+            pass
         else:
             log.debug("Unhandled response %r", MsgC2S.lookup(ptype))
             raise ProtocolError(ptype)
@@ -342,6 +344,7 @@ class VNCLoggingServerFactory(portforward.ProxyFactory):  # type: ignore[misc]
     pseudodesktop = True
     qemu_extended_key = True
     last_rect = True
+    fence = False
     force_caps = False
 
     password_required = False

The 2nd hunk is the missing one; the 1st one should be the location, where proper handling for CLIENT_FENCE should go in if FENCE should be handled, too.

@pmhahn pmhahn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vncdotool/loggingproxy.py at least needs fence = False; more work if True.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants