1 --- a/saslauthd/auth_rimap.c
2 +++ b/saslauthd/auth_rimap.c
5 /* MODULE: auth_rimap */
8 @@ -367,6 +368,30 @@ auth_rimap (
9 alarm(NETWORK_IO_TIMEOUT);
10 rc = read(s, rbuf, sizeof(rbuf));
13 + /* check if there is more to read */
16 + struct timeval timeout;
23 + timeout.tv_usec = 0;
24 + while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
25 + if ( FD_ISSET(s, &perm) ) {
26 + ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
37 syslog(LOG_WARNING, "auth_rimap: read (banner): %m");
39 @@ -456,6 +481,30 @@ auth_rimap (
40 alarm(NETWORK_IO_TIMEOUT);
41 rc = read(s, rbuf, sizeof(rbuf));
44 + /* check if there is more to read */
47 + struct timeval timeout;
54 + timeout.tv_usec = 0;
55 + while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
56 + if ( FD_ISSET(s, &perm) ) {
57 + ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
67 (void) close(s); /* we're done with the remote */
69 syslog(LOG_WARNING, "auth_rimap: read (response): %m");
72 @@ -587,16 +587,14 @@ static int read_wait(int fd, unsigned de
77 - if (FD_ISSET(fd, &rfds)) {
78 - /* Success, file descriptor is readable. */
83 if (errno == EINTR || errno == EAGAIN)
86 + if (FD_ISSET(fd, &rfds)) {
87 + /* Success, file descriptor is readable. */
90 /* Error catch-all. */