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

Diff of /imapfilter/socket.c

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

revision 1.38 by lefcha, Tue Feb 10 22:21:09 2004 UTC revision 1.39 by lefcha, Fri Feb 13 12:17:16 2004 UTC
# Line 5  Line 5 
5  #include <netinet/in.h>  #include <netinet/in.h>
6  #include <netdb.h>  #include <netdb.h>
7  #include <sys/socket.h>  #include <sys/socket.h>
8  #include <sys/types.h>          /* IEEE Std 1003.1-2001 non-conformance. */  #include <sys/types.h>          /* IEEE Std 1003.1-2001 transitional. */
9  #include <sys/time.h>           /* IEEE Std 1003.1-2001 non-conformance. */  #include <sys/time.h>           /* IEEE Std 1003.1-2001 transitional. */
10  #include <sys/select.h>  #include <sys/select.h>
11  #include <fcntl.h>  #include <fcntl.h>
12    
# Line 19  Line 19 
19  #endif  #endif
20    
21    
22  extern opts_t opts;  extern options_t opts;
23  extern conn_t connpri, connaux;  extern connection_t connpri, connaux;
24    
25    
26  /*  /*
27   * Connect to mail server.   * Connect to mail server.
28   */   */
29  int  int
30  init_connection(conn_t * conn, char *serv, unsigned short int port,  init_connection(connection_t * conn, char *serv, unsigned short int port,
31      unsigned int protocol)      unsigned int protocol)
32  {  {
33          struct sockaddr_in sa;          struct sockaddr_in sa;
# Line 87  init_connection(conn_t * conn, char *ser Line 87  init_connection(conn_t * conn, char *ser
87   * Initialize Secure Socket Layer connection.   * Initialize Secure Socket Layer connection.
88   */   */
89  int  int
90  init_secure_connection(conn_t * conn, unsigned int protocol)  init_secure_connection(connection_t * conn, unsigned int protocol)
91  {  {
92          int e;          int e;
93          SSL_CTX *ctx;          SSL_CTX *ctx;
# Line 155  fail: Line 155  fail:
155   * Disconnect from mail server.   * Disconnect from mail server.
156   */   */
157  int  int
158  close_connection(conn_t * conn)  close_connection(connection_t * conn)
159  {  {
160  #ifdef SSL_TLS  #ifdef SSL_TLS
161          if (conn->ssl) {          if (conn->ssl) {
# Line 178  close_connection(conn_t * conn) Line 178  close_connection(conn_t * conn)
178   * Read data from socket.   * Read data from socket.
179   */   */
180  int  int
181  socket_read(conn_t * conn, char *buf)  socket_read(connection_t * conn, char *buf)
182  {  {
183          int f, e, s;          int f, e, s;
184          fd_set fds;          fd_set fds;
# Line 259  socket_read(conn_t * conn, char *buf) Line 259  socket_read(conn_t * conn, char *buf)
259   * Write data to socket.   * Write data to socket.
260   */   */
261  int  int
262  socket_write(conn_t * conn, char *data)  socket_write(connection_t * conn, char *data)
263  {  {
264          int f, e, s;          int f, e, s;
265          fd_set fds;          fd_set fds;

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26