]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/tls.c
Fix typo.
[bacula/bacula] / bacula / src / lib / tls.c
index e67f75818eee1b0de3b24698260b106d1d5ef869..344fe79053fd7f0c648a7e680b7362e31f363e72 100644 (file)
@@ -6,7 +6,7 @@
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -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);