Don't crash if gnutls_handshake fails

In some situations involving Internet access not being fully
functional, gnutls_handshake returns a fatal error, which we were
ignoring, causing us to call gnutls_handshake again.  Now we check for
the error and return it to the caller.

* src/gnutls.c (gnutls_try_handshake): Return immediately if
gnutls_handshake returns a fatal error (Bug#46709).
This commit is contained in:
Robert Pluim 2021-02-25 16:36:56 +01:00
parent 6c5e86fc17
commit d84d69dfbc

View file

@ -625,6 +625,8 @@ 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);