]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.2.x/2.2.3-tls.patch
Fix misnamed variable
[bacula/bacula] / bacula / patches / 2.2.x / 2.2.3-tls.patch
1
2  This patch was supplied by Landon Fuller and corrects a bug that
3  caused high CPU usage when connecting from bconsole to the Director.
4  This fixes bug #944.
5
6  Apply this patch to version 2.2.3 (it should work with any 2.2.x 
7  version with:
8
9   cd <bacula-source>
10   patch -p0 <2.2.3-tls.patch
11   ./configure (your options)
12   make
13   ...
14   make install
15
16 Index: src/lib/tls.c
17 ===================================================================
18 --- src/lib/tls.c       (revision 5507)
19 +++ src/lib/tls.c       (working copy)
20 @@ -622,13 +622,21 @@
21           break;
22  
23        case SSL_ERROR_WANT_READ:
24 +         /* If we timeout on a select, this will be unset */
25 +         FD_SET((unsigned)bsock->m_fd, &fdset);
26 +         tv.tv_sec = 10;
27 +         tv.tv_usec = 0;
28 +         /* Block until we can read */
29 +         select(fdmax, &fdset, NULL, NULL, &tv);
30 +         break;
31 +
32        case SSL_ERROR_WANT_WRITE:
33           /* If we timeout on a select, this will be unset */
34           FD_SET((unsigned)bsock->m_fd, &fdset);
35           tv.tv_sec = 10;
36           tv.tv_usec = 0;
37 -         /* Block until we can read or write */
38 -         select(fdmax, NULL, &fdset, &fdset, &tv);
39 +         /* Block until we can write */
40 +         select(fdmax, NULL, &fdset, NULL, &tv);
41           break;
42  
43        case SSL_ERROR_ZERO_RETURN: