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

Diff of /imapfilter/socket.c

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

revision 1.8 by lefcha, Fri Nov 9 16:55:15 2001 UTC revision 1.9 by lefcha, Fri Nov 9 17:32:43 2001 UTC
# Line 42  int init_connection(char *serv, unsigned Line 42  int init_connection(char *serv, unsigned
42          error("imapfilter: create socket; %s\n", strerror(errno));          error("imapfilter: create socket; %s\n", strerror(errno));
43          return ERROR_NETWORK;          return ERROR_NETWORK;
44      }      }
45    
46      if (!(he = gethostbyname(serv))) {      if (!(he = gethostbyname(serv))) {
47          error("imapfilter: get network host entry; %s\n", strerror(errno));          error("imapfilter: get network host entry; %s\n", strerror(errno));
48          close_connection();          close_connection();
# Line 51  int init_connection(char *serv, unsigned Line 52  int init_connection(char *serv, unsigned
52      sa.sin_port = htons(port);      sa.sin_port = htons(port);
53      sa.sin_addr = *(struct in_addr *) he->h_addr;      sa.sin_addr = *(struct in_addr *) he->h_addr;
54    
55        xstrncpy(serv, he->h_name, SERVER_LEN - 1);
56    
57      if (connect(sock, (struct sockaddr *) & sa, sizeof(struct sockaddr))) {      if (connect(sock, (struct sockaddr *) & sa, sizeof(struct sockaddr))) {
58          error("imapfilter: initiating connection; %s\n", strerror(errno));          error("imapfilter: initiating connection to %s; %s\n", serv, strerror(errno));
59          close_connection();          close_connection();
60          return ERROR_NETWORK;          return ERROR_NETWORK;
61      }      }
     xstrncpy(serv, he->h_name, SERVER_LEN - 1);  
62    
63      log_info(LOG_SERVER, serv);      log_info(LOG_SERVER, serv);
64    
65  #ifdef SSL_TLS  #ifdef SSL_TLS
66      if (protocol != SSL_DISABLED) {      if (protocol != SSL_DISABLED && !ssl_init(protocol)) {
67          if (!ssl_init(protocol)) {          info("Connected to %s using %s.\n", serv, SSL_get_cipher(ssl));
68              info("Connected to %s using %s.\n", serv, SSL_get_cipher(ssl));          return 0;
             return 0;  
         }  
69      } else      } else
70          ssl = NULL;          ssl = NULL;
71  #endif  #endif

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26