Fix reading of TLS data to account for cached data
When you ask GnuTLS to read 'n' bytes of data it is free to read many more than just 'n' bytes, since there is no 1-1 mapping between encrypted and unencrypted byte counts. The Vino I/O handle triggered when POLLIN reads one single RFB message, then checks if POLLIN is still set. This is broken if gnutls has previously read more than one RFB message worth of data. A symptom of this brokeness is that when connecting to a Vino server with gtk-vnc, the screen will be initially black until the user moves the mouse or presses a key. Even then there will be periodic delays in updates if the pending data condition arises again. Fortunately GnuTLS has a function gnutls_record_check_pending which lets apps determine if there is any cached data read off the wire. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=703326
parent
3601d0f0
Please register or sign in to comment