diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gnutls.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gnutls.c b/src/gnutls.c index 3ec38370679..09590ca005c 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -616,6 +616,9 @@ gnutls_try_handshake (struct Lisp_Process *proc) | |||
| 616 | gnutls_session_t state = proc->gnutls_state; | 616 | gnutls_session_t state = proc->gnutls_state; |
| 617 | int ret; | 617 | int ret; |
| 618 | bool non_blocking = proc->is_non_blocking_client; | 618 | bool non_blocking = proc->is_non_blocking_client; |
| 619 | /* Sleep for ten milliseconds when busy-looping in | ||
| 620 | gnutls_handshake. */ | ||
| 621 | struct timespec delay = { 0, 1000 * 1000 * 10 }; | ||
| 619 | 622 | ||
| 620 | if (proc->gnutls_complete_negotiation_p) | 623 | if (proc->gnutls_complete_negotiation_p) |
| 621 | non_blocking = false; | 624 | non_blocking = false; |
| @@ -630,6 +633,7 @@ gnutls_try_handshake (struct Lisp_Process *proc) | |||
| 630 | maybe_quit (); | 633 | maybe_quit (); |
| 631 | if (non_blocking && ret != GNUTLS_E_INTERRUPTED) | 634 | if (non_blocking && ret != GNUTLS_E_INTERRUPTED) |
| 632 | break; | 635 | break; |
| 636 | nanosleep (&delay, NULL); | ||
| 633 | } | 637 | } |
| 634 | 638 | ||
| 635 | proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; | 639 | proc->gnutls_initstage = GNUTLS_STAGE_HANDSHAKE_TRIED; |