From: Kern Sibbald Date: Wed, 7 Jul 2010 05:49:48 +0000 (+0200) Subject: Fix for TLS bugs #1568 and #1599 X-Git-Tag: Release-7.0.0~1692 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fcdb4fcab7b8b8d3dad7b3ae08df119efd352a73;p=bacula%2Fbacula Fix for TLS bugs #1568 and #1599 --- diff --git a/bacula/src/lib/tls.c b/bacula/src/lib/tls.c index e67f75818e..1dd53152e0 100644 --- a/bacula/src/lib/tls.c +++ b/bacula/src/lib/tls.c @@ -637,6 +637,19 @@ static inline int openssl_bsock_readwrite(BSOCK *bsock, char *ptr, int nbytes, b } break; + case SSL_ERROR_SYSCALL: + if (nwritten == -1) { + if (errno == EINTR) { + continue; + } + if (errno == EAGAIN) { + bmicrosleep(0, 20000); /* try again in 20 ms */ + continue; + } + } + openssl_post_errors(bsock->get_jcr(), M_FATAL, _("TLS read/write failure.")); + goto cleanup; + case SSL_ERROR_WANT_READ: /* If we timeout on a select, this will be unset */ FD_SET((unsigned)bsock->m_fd, &fdset);