/[imapfilter]/imapfilter/socket.c
ViewVC logotype

Diff of /imapfilter/socket.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by lefcha, Mon Oct 28 23:06:41 2002 UTC revision 1.23 by lefcha, Sat Jan 18 02:06:23 2003 UTC
# Line 230  int socket_read(int *sock, char *buf) Line 230  int socket_read(int *sock, char *buf)
230      if (*ssl) {      if (*ssl) {
231    
232          for (;;) {          for (;;) {
233              if (SSL_pending(*ssl)              if (SSL_pending(*ssl) ||
234                  || ((s = select(*sock + 1, &fds, NULL, NULL, tvp)) > 0                  ((s = select(*sock + 1, &fds, NULL, NULL, tvp)) > 0 &&
235                      && FD_ISSET(*sock, &fds)))                   FD_ISSET(*sock, &fds)))
236                  e = SSL_read(*ssl, buf, RESPONSE_BUF - 1);                  e = SSL_read(*ssl, buf, RESPONSE_BUF - 1);
237    
238              if (e > 0)              if (e > 0)
# Line 253  int socket_read(int *sock, char *buf) Line 253  int socket_read(int *sock, char *buf)
253          }          }
254      } else      } else
255  #endif  #endif
256          if ((s = select(*sock + 1, &fds, NULL, NULL, tvp)) > 0          if ((s = select(*sock + 1, &fds, NULL, NULL, tvp)) > 0 &&
257              && FD_ISSET(*sock, &fds))              FD_ISSET(*sock, &fds))
258          e = read(*sock, buf, RESPONSE_BUF - 1);          e = read(*sock, buf, RESPONSE_BUF - 1);
259    
260      if (e == -1)      if (e == -1)
# Line 305  int socket_write(int *sock, char *data) Line 305  int socket_write(int *sock, char *data)
305  #ifdef SSL_TLS  #ifdef SSL_TLS
306      if (*ssl) {      if (*ssl) {
307          for (;;) {          for (;;) {
308              if ((s = select(*sock + 1, NULL, &fds, NULL, tvp) > 0              if ((s = select(*sock + 1, NULL, &fds, NULL, tvp) > 0 &&
309                   && FD_ISSET(*sock, &fds)))                   FD_ISSET(*sock, &fds)))
310                  e = SSL_write(*ssl, data, strlen(data));                  e = SSL_write(*ssl, data, strlen(data));
311    
312              if (e > 0)              if (e > 0)
# Line 327  int socket_write(int *sock, char *data) Line 327  int socket_write(int *sock, char *data)
327          }          }
328      } else      } else
329  #endif  #endif
330          if ((s = select(*sock + 1, NULL, &fds, NULL, tvp)) > 0          if ((s = select(*sock + 1, NULL, &fds, NULL, tvp)) > 0 &&
331              && FD_ISSET(*sock, &fds))              FD_ISSET(*sock, &fds))
332          e = write(*sock, data, strlen(data));          e = write(*sock, data, strlen(data));
333    
334      if (e == -1)      if (e == -1)

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26