Re: libetpan with openssl on windows

Michael Leupold <[email protected]> Sat, 22 Apr 2006 15:29:20 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
Am Samstag, 22. April 2006 15:22 schrieb DINH Viet Hoa:
> that's ok for me but still I can't remember why I put sockets on
> non-blocking mode in SSL stream.
> Could you show the patch before applying it ?

That's what I intended as I have no insight on the stream-stuff. Find the 
patch attached.

Regards,
Michael
mailstream_ssl.diff (text/x-diff, 828 B)
Index: mailstream_ssl.c
===================================================================
RCS file: /cvsroot/libetpan/libetpan/src/data-types/mailstream_ssl.c,v
retrieving revision 1.36
diff -u -r1.36 mailstream_ssl.c
--- mailstream_ssl.c	16 Apr 2006 12:30:41 -0000	1.36
+++ mailstream_ssl.c	22 Apr 2006 12:18:18 -0000
@@ -161,6 +161,7 @@
 #ifdef USE_SSL
 static inline int mailstream_prepare_fd(int fd)
 {
+#ifndef _MSC_VER
   int fd_flags;
   int r;
   
@@ -169,7 +170,7 @@
   r = fcntl(fd, F_SETFL, fd_flags);
   if (r < 0)
     return -1;
-  
+#endif
   return 0;
 }
 #endif
@@ -327,7 +328,12 @@
   ssl_data->ssl_conn = NULL;
   SSL_CTX_free(ssl_data->ssl_ctx);
   ssl_data->ssl_ctx  = NULL;
+#ifdef _MSC_VER
+/* SEB */ 
+  closesocket(ssl_data->fd);
+#else
   close(ssl_data->fd);
+#endif
   ssl_data->fd = -1;
 }
 #else