Repository navigation
Conversation
… fallback rfbSendServerCutTextUTF8() locks the sendMutex of each client, but did not unlock it for a client without Extended Clipboard when no Latin-1 fallback text is given. Nothing could be sent to that client afterwards. Add cuttexttest, which checks that the mutex is released with and without the fallback text.
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.
rfbSendServerCutTextUTF8()takes thesendMutexof every client at the start of its loop. The Extended Clipboard branch and the Latin-1 fallback branch release it, but nothing does when the client has no Extended Clipboard andfallbackLatin1StrisNULL. The mutex then stays locked, and anything else sent to that client blocks: framebuffer updates, xvp replies, bells.This dates back to the UTF-8 clipboard support (26bf374, LibVNCServer 0.9.14). Applications that always pass a Latin-1 fallback are not affected.
Found by @mikaelpelle while validating #768 (see #767).
Changes
elsebranch.test/cuttexttest.c(CTestcuttext). A client connected throughsocketpair(), with no listening socket, receives a text with and without the fallback, and the test checks withpthread_mutex_trylock()that itssendMutexis free afterwards. The test is built everywhere and skips itself without pthreads, zlib orsocketpair().Testing
Linux x86_64, gcc 13, Debug and Release:
cuttextfails on master withwithout Latin-1 fallback: sendMutex left locked, and passes with the fix.cuttexttestreports nothing.sendmutex.Not changed here
rfbCloseClient()withsendMutexheld. libvncserver: synchronize client encoding updates with framebuffer transmission #768 lists this among the remaining cases.leninstead oflatin1Len.