Closed mdevaev closed 1 year ago
@mdevaev That looks reasonable, but why not reap the rewards and remove the busy wait in tls_gnutls.c?
What do you mean?
What do you mean?
I mean the while loop here https://github.com/LibVNC/libvncserver/blob/master/libvncclient/tls_gnutls.c#L285 can probably be turned into an if.
As far as I understood from the documentation and examples, there really should be a loop here, because some errors may be non-fatal and it is recommended to just try handshake again.
Yes, you're right. Check it please now.
Done, check it plz
Thanks, it's a pleasure working with you.
Thank you!)
Following #525
Removed sleep, using
gnutls_handshake_set_timeout()
andgnutls_system_recv_timeout()
. It's working since GNUTLS 3.4.0 (released 2015-04-08).Found a solution here: https://github.com/gnutls/gnutls/blob/857543cc24114431dd5dde0e83c2c44b9b7e6050/lib/system/fastopen.c#L167
Also a loop without sleep seems to be the regular way to use GNUTLS according to github.