/[anubis]/anubis/testsuite/mta.c
ViewVC logotype

Diff of /anubis/testsuite/mta.c

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

revision 1.6 by gray, Fri Jun 20 15:10:41 2003 UTC revision 1.7 by gray, Tue Jul 1 15:23:36 2003 UTC
# Line 71  Line 71 
71  #include <sys/socket.h>  #include <sys/socket.h>
72  #include <netinet/in.h>  #include <netinet/in.h>
73    
74  #if defined(HAVE_LIBGCRYPT) && defined(HAVE_LIBGNUTLS) && defined(HAVE_GNUTLS_GNUTLS_H)  #if defined(USE_GNUTLS) && defined(HAVE_GNUTLS_GNUTLS_H)
 # define HAVE_GNUTLS  
 #endif  
 #if defined(USE_GNUTLS) && defined(HAVE_GNUTLS)  
75  # include <gnutls/gnutls.h>  # include <gnutls/gnutls.h>
76  # define HAVE_TLS  # define HAVE_TLS
77  #endif /* USE_GNUTLS and HAVE_GNUTLS */  #endif /* USE_GNUTLS and HAVE_GNUTLS_GNUTLS_H */
78    
79  FILE *diag = NULL;       /* diagnostic output */  FILE *diag = NULL;       /* diagnostic output */
80  int port = 0;            /* Port number (for smtp mode) */  int port = 0;            /* Port number (for smtp mode) */
# Line 308  _tls_fd_pull(gnutls_transport_ptr fd, vo Line 305  _tls_fd_pull(gnutls_transport_ptr fd, vo
305  {  {
306          int rc;          int rc;
307          do {          do {
308                  rc = read(fd, buf, size);                  rc = read((int) fd, buf, size);
309          } while (rc == -1 && errno == EAGAIN);          } while (rc == -1 && errno == EAGAIN);
310          return rc;          return rc;
311  }  }
# Line 318  _tls_fd_push(gnutls_transport_ptr fd, co Line 315  _tls_fd_push(gnutls_transport_ptr fd, co
315  {  {
316          int rc;          int rc;
317          do {          do {
318                  rc = write(fd, buf, size);                  rc = write((int) fd, buf, size);
319          } while (rc == -1 && errno == EAGAIN);          } while (rc == -1 && errno == EAGAIN);
320          return rc;          return rc;
321  }  }
# Line 382  tls_session_init(void) Line 379  tls_session_init(void)
379          gnutls_transport_set_pull_function(session, _tls_fd_pull);          gnutls_transport_set_pull_function(session, _tls_fd_pull);
380          gnutls_transport_set_push_function(session, _tls_fd_push);          gnutls_transport_set_push_function(session, _tls_fd_push);
381    
382          gnutls_transport_set_ptr2(session, (int)in, (int)out);          gnutls_transport_set_ptr2(session,
383                                      (gnutls_transport_ptr)in,
384                                      (gnutls_transport_ptr)out);
385          rc = gnutls_handshake(session);          rc = gnutls_handshake(session);
386          if (rc < 0) {          if (rc < 0) {
387                  gnutls_deinit(session);                  gnutls_deinit(session);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26