1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

De-obfuscate gnutls_handshake loop

* src/gnutls.c (gnutls_try_handshake): Rewrite the handshake loop
for greater clarity (bug#49055).
This commit is contained in:
dickmao 2021-06-19 15:19:04 +02:00 committed by Lars Ingebrigtsen
parent 1293ece461
commit 234bf1b636

View File

@ -625,16 +625,11 @@ gnutls_try_handshake (struct Lisp_Process *proc)
while ((ret = gnutls_handshake (state)) < 0)
{
if (gnutls_error_is_fatal (ret))
return emacs_gnutls_handle_error (state, ret);
do
ret = gnutls_handshake (state);
while (ret == GNUTLS_E_INTERRUPTED);
if (0 <= ret || emacs_gnutls_handle_error (state, ret) == 0
|| non_blocking)
if (emacs_gnutls_handle_error (state, ret) == 0) /* fatal */
break;
maybe_quit ();
if (non_blocking && ret != GNUTLS_E_INTERRUPTED)
break;
}
proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED;