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

Diff of /imapfilter/socket.c

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

revision 1.13 by lefcha, Sun Nov 18 13:07:47 2001 UTC revision 1.14 by lefcha, Sat Dec 8 14:44:16 2001 UTC
# Line 18  Line 18 
18  #endif  #endif
19    
20    
21  extern long timeout;  long timeout = -1;              /* Server non-response timeout in seconds. */
22    
23  static int sock;  static int sock;
24    
# Line 33  static SSL *ssl; Line 33  static SSL *ssl;
33  #ifndef SSL_TLS  #ifndef SSL_TLS
34  int init_connection(char *serv, unsigned short int port)  int init_connection(char *serv, unsigned short int port)
35  #else  #else
36  int init_connection(char *serv, unsigned short int port, unsigned int protocol)  int init_connection(char *serv, unsigned short int port,
37                         unsigned int protocol)
38  #endif  #endif
39  {  {
40      struct sockaddr_in sa;      struct sockaddr_in sa;
# Line 60  int init_connection(char *serv, unsigned Line 61  int init_connection(char *serv, unsigned
61      xstrncpy(serv, he->h_name, SERVER_LEN - 1);      xstrncpy(serv, he->h_name, SERVER_LEN - 1);
62    
63      if (connect(sock, (struct sockaddr *) & sa, sizeof(struct sockaddr))) {      if (connect(sock, (struct sockaddr *) & sa, sizeof(struct sockaddr))) {
64          error("imapfilter: initiating connection to %s; %s\n", serv, strerror(errno));          error("imapfilter: initiating connection to %s; %s\n", serv,
65                  strerror(errno));
66          close_connection();          close_connection();
67          return ERROR_NETWORK;          return ERROR_NETWORK;
68      }      }
# Line 193  int socket_read(char *buf) Line 195  int socket_read(char *buf)
195    
196      memset(buf, 0, RESPONSE_BUF);      memset(buf, 0, RESPONSE_BUF);
197    
198      if (timeout) {      if (timeout >= 0) {
199          tv.tv_sec = timeout;          tv.tv_sec = timeout;
200          tv.tv_usec = 0;          tv.tv_usec = 0;
201          tvp = &tv;          tvp = &tv;

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26