rfbserver: send the ExtDesktopSize pseudo-rect only once per client - #743
Open
slab-tsuchiya wants to merge 1 commit into
Open
rfbserver: send the ExtDesktopSize pseudo-rect only once per client#743slab-tsuchiya wants to merge 1 commit into
slab-tsuchiya wants to merge 1 commit into
Conversation
Every non-incremental FramebufferUpdateRequest from an ExtDesktopSize-capable client set newFBSizePending, and a pending new-FB-size makes the server emit an ExtDesktopSize rectangle and return without sending any pixels. Viewers that ask for a full update again after receiving that rectangle -- notably UltraVNC in its "new ultra server" mode, which sends non-incremental requests repeatedly -- therefore loop forever receiving only size rectangles, and the screen never updates. Track whether the initial ExtDesktopSize has been sent to a client and only re-assert it from a full-screen request until then. Genuine resizes still re-send it: they go through rfbNewFramebuffer(), which sets newFBSizePending directly, and the send path re-arms the flag. Other viewers are unaffected (they only ever needed the size once).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a client enables the ExtDesktopSize pseudo-encoding, every non-incremental
FramebufferUpdateRequestsetscl->newFBSizePending, and a pending new-FB-size makesrfbSendFramebufferUpdate()emit only anExtDesktopSizerectangle and return withoutsending any pixels.
Most viewers send an incremental request after the first full one, so they receive the
size once and then get pixels. But a viewer that requests a full update again after
each
ExtDesktopSize— notably UltraVNC Viewer in its "new ultra server" mode — neverconverges: it loops forever receiving only size rectangles, and the screen never updates.
Reproduce
Connect an UltraVNC Viewer to a libvncserver-based server that has ExtDesktopSize enabled
(the viewer advertises the pseudo-encoding automatically). The server log fills with
and the framebuffer is never painted.
Fix
Track whether the initial
ExtDesktopSizehas been sent to a client(
cl->extDesktopSizeSent) and only re-assert it from a full-screen request until then.Genuine resizes are unaffected: they set
newFBSizePendingthroughrfbNewFramebuffer(),not through this per-request path, and the send path re-arms the flag. Viewers that only
ever needed the size once behave exactly as before.
Small and self-contained: one new client flag plus a guard. Verified against a real
UltraVNC Viewer (screen now paints normally) and with a protocol probe that mimics the
"request a full update after every ExtDesktopSize" behaviour: the size rectangle is sent
exactly once, then pixels follow.