From 36c900fb44ff3da949ccd492e5e54b61a47f7441 Mon Sep 17 00:00:00 2001 From: dickmao Date: Tue, 15 Jun 2021 21:03:40 -0400 Subject: [PATCH] De-obfuscate gnutls_handshake loop Every 12 hours, I have to C-g out of gnutls_boot() when accessing a webpage. I need to figure out why, but until then can we make the relevant loop less confusing? * src/gnutls.c (gnutls_try_handshake): De-obfuscate. --- src/gnutls.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/gnutls.c b/src/gnutls.c index 4d5a909db0..22e7f2cbc1 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -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; -- 2.26.2