This is my result from looking at #205, which tried to force ARD to use BRG;16 instead of RGB32. This PR introduces a new class PixelFormat based on dataclasses to pass around those many values of PIXEL_FORMAT.
As usual I found some more issues on my way:
The Encoding.lookup() was not working for Encodings defined via negative numbers, but where looked up using a unsigned-int.
Pseudo-Cursors using RGB24 was not handles correctly
Simplified one location doing integer math
Improved and added some more debug logging
Add NullTransport.loseConnection required for logproxy
The last one is problematic and incomplete, but I currently have no idea myself how to fix it for real: The bigger picture is that currently stream handling is wrong in several cases: As neither TCP nor the RFB/VNC protocol defines any framing, all messages passed from client-to-server and server-to-client must be understood and handled.
While testing with gvncviewer as my client connecting LibVNCServer-0.9.14/examples/pnmshow24 as my server via vnclog I noticed, that they negotiated many more pseudo encoding than vnclog understands and can handle:
Afterwards vnclog is out-of-synchronisation and starts logging many errors as most following bytes are seen as an unknown Server-to-Client message ID.
To handle this correctly vnclog needs to sit in-between of the client and the server and must rewrite some of those messages to filter out any AuthType, Encoding, … vncdotool does not understand.
That's too much for me to do as of now, but someone might work on that. At least the PR improves the situation, but there is more work to do. Feel free to merge now and create new issues for the newly identified issues — or delay this PR until we have some idea on how to fix them.
This is my result from looking at #205, which tried to force ARD to use
BRG;16
instead ofRGB32
. This PR introduces a new classPixelFormat
based ondataclasses
to pass around those many values of PIXEL_FORMAT.As usual I found some more issues on my way:
Encoding.lookup()
was not working for Encodings defined via negative numbers, but where looked up using a unsigned-int.RGB24
was not handles correctlyNullTransport.loseConnection
required forlogproxy
The last one is problematic and incomplete, but I currently have no idea myself how to fix it for real: The bigger picture is that currently stream handling is wrong in several cases: As neither TCP nor the RFB/VNC protocol defines any framing, all messages passed from client-to-server and server-to-client must be understood and handled. While testing with
gvncviewer
as my client connectingLibVNCServer-0.9.14/examples/pnmshow24
as my server viavnclog
I noticed, that they negotiated many more pseudo encoding thanvnclog
understands and can handle:The
pnmshow24
server supports many of them, but not all:The last one is problematic as this results in a FramebufferUpdate-Message with the
Encoding.TIGHT
pseudo-encoding, whichvncdotool
cannot handle:Afterwards
vnclog
is out-of-synchronisation and starts logging many errors as most following bytes are seen as an unknown Server-to-Client message ID.To handle this correctly
vnclog
needs to sit in-between of the client and the server and must rewrite some of those messages to filter out anyAuthType
,Encoding
, …vncdotool
does not understand.That's too much for me to do as of now, but someone might work on that. At least the PR improves the situation, but there is more work to do. Feel free to merge now and create new issues for the newly identified issues — or delay this PR until we have some idea on how to fix them.