/[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.4 by lefcha, Sun Feb 2 17:43:45 2003 UTC revision 1.19.2.5 by lefcha, Sat Mar 8 01:37:01 2003 UTC
# Line 242  int socket_read(int *sock, char *buf) Line 242  int socket_read(int *sock, char *buf)
242              case SSL_ERROR_WANT_READ:              case SSL_ERROR_WANT_READ:
243              case SSL_ERROR_WANT_WRITE:              case SSL_ERROR_WANT_WRITE:
244                  continue;                  continue;
245                case SSL_ERROR_ZERO_RETURN:
246                     return ERROR_NETWORK;
247              case SSL_ERROR_SYSCALL:              case SSL_ERROR_SYSCALL:
248              case SSL_ERROR_SSL:              case SSL_ERROR_SSL:
249                  fatal(ERROR_NETWORK, "imapfilter: reading data; %s",                  fatal(ERROR_NETWORK, "imapfilter: reading data; %s",
# Line 253  int socket_read(int *sock, char *buf) Line 255  int socket_read(int *sock, char *buf)
255          }          }
256      } else      } else
257  #endif  #endif
258        {
259          if ((s = select(*sock + 1, &fds, NULL, NULL, tvp)) > 0 &&          if ((s = select(*sock + 1, &fds, NULL, NULL, tvp)) > 0 &&
260              FD_ISSET(*sock, &fds))              FD_ISSET(*sock, &fds))
261          e = read(*sock, buf, RESPONSE_BUF - 1);              e = read(*sock, buf, RESPONSE_BUF - 1);
262            
263      if (e == -1)          if (e == -1)
264          fatal(ERROR_NETWORK, "imapfilter: reading data; %s",              fatal(ERROR_NETWORK, "imapfilter: reading data; %s",
265                strerror(errno));                    strerror(errno));
266            else if (e == 0)
267                return ERROR_NETWORK;
268        }
269    
270      fcntl(*sock, F_SETFL, f);      fcntl(*sock, F_SETFL, f);
271    
# Line 316  int socket_write(int *sock, char *data) Line 322  int socket_write(int *sock, char *data)
322              case SSL_ERROR_WANT_READ:              case SSL_ERROR_WANT_READ:
323              case SSL_ERROR_WANT_WRITE:              case SSL_ERROR_WANT_WRITE:
324                  continue;                  continue;
325                case SSL_ERROR_ZERO_RETURN:
326                     return ERROR_NETWORK;
327              case SSL_ERROR_SYSCALL:              case SSL_ERROR_SYSCALL:
328              case SSL_ERROR_SSL:              case SSL_ERROR_SSL:
329                  fatal(ERROR_NETWORK, "imapfilter: writing data; %s",                  fatal(ERROR_NETWORK, "imapfilter: writing data; %s",
# Line 327  int socket_write(int *sock, char *data) Line 335  int socket_write(int *sock, char *data)
335          }          }
336      } else      } else
337  #endif  #endif
338        {
339          if ((s = select(*sock + 1, NULL, &fds, NULL, tvp)) > 0 &&          if ((s = select(*sock + 1, NULL, &fds, NULL, tvp)) > 0 &&
340              FD_ISSET(*sock, &fds))              FD_ISSET(*sock, &fds))
341          e = write(*sock, data, strlen(data));              e = write(*sock, data, strlen(data));
342            
343      if (e == -1)          if (e == -1)
344          fatal(ERROR_NETWORK, "imapfilter: writing data; %s",              fatal(ERROR_NETWORK, "imapfilter: writing data; %s",
345                strerror(errno));                    strerror(errno));
346        }
347    
348      fcntl(*sock, F_SETFL, f);      fcntl(*sock, F_SETFL, f);
349    

Legend:
Removed from v.1.19.2.4  
changed lines
  Added in v.1.19.2.5

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26