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-5.2.1~1227 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=30bd99d075c8f39e8865b8a5aa38105f93703206;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);