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

Diff of /imapfilter/socket.c

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

revision 1.19.2.3 by lefcha, Mon Oct 28 23:07:16 2002 UTC revision 1.19.2.4 by lefcha, Sun Feb 2 17:43:45 2003 UTC
# Line 106  int ssl_init(int *sock, unsigned int pro Line 106  int ssl_init(int *sock, unsigned int pro
106      SSL_METHOD *method = NULL;      SSL_METHOD *method = NULL;
107      X509 *cert;      X509 *cert;
108      char *c;      char *c;
109      EVP_MD *evp;      const EVP_MD *evp;
110      unsigned char digest[EVP_MAX_MD_SIZE];      unsigned char digest[EVP_MAX_MD_SIZE];
111      SSL **ssl = (sock == &sockpri ? &sslpri : &sslaux);      SSL **ssl = (sock == &sockpri ? &sslpri : &sslaux);
112    
# 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.19.2.3  
changed lines
  Added in v.1.19.2.4

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26