GNOME Bugzilla – Bug 703326
vino message processing code fails to take account of cached pending data in gnutls buffers
Last modified: 2013-09-16 20:31:08 UTC
I don't know why, but it seems the first framebuffer update request is lost, and is only sent when we process another event. for example: connect to a gnome server (vino) and do not send any event (mouse or keyboard). the screen remains black until you generate some event. if you are connecting in view-only mode, the screen remains black forever, because we are not generating any event, and the server didn't send any event either. tested with vinagre and gvnc.
Created attachment 248062 [details] [review] proposed patch I've tried to debug the real cause of this issue, without success. This patch however seems to fix it.
*** Bug 703026 has been marked as a duplicate of this bug. ***
There is no flaw in GTK-VNC. Using a combination of strace + gtk-vnc's debug capabilities shows the first frame buffer update request being sent at the right time. It also shows that the vino server receives the data. The actual problem is that vino is not correctly processing incoming data when TLS is enabled. It doesn't take account of the fact that gnutls is free to read more bytes than asked, and will cache the unused bytes. This breaks the logic in vino's vino_server_client_data_pending method, which process 1 single RFB message then checks for POLLIN condition again. This condition is not true, but there is still pending data in the gnutls buffers.
Created attachment 255038 [details] [review] Use gnutls_record_check_pending call
Comment on attachment 255038 [details] [review] Use gnutls_record_check_pending call Thanks for the fix, Daniel! I pushed your patch to master as commit 3b38cf49321924ff2ec657a6e4db8a1932245ef9.