commit 8f27b878dd43155329450de77bda3b6f75623b18
Author: Oswald Buddenhagen <[email protected]>
Date:   Mon Apr 5 13:15:57 2010 +0200

    assert valid file handles
    
    i've seen error logs of the type
      SSL_write: Bad file descriptor
    and i simply can't nail it, so go for some more drastic measures.

 src/drv_imap.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c
index f417385..7ddf81e 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -384,7 +384,10 @@ socket_perror( const char *func, Socket_t *sock, int ret )
 static int
 socket_read( Socket_t *sock, char *buf, int len )
 {
-       int n =
+       int n;
+
+       assert( sock->fd >= 0 );
+       n =
 #if HAVE_LIBSSL
                sock->use_ssl ? SSL_read( sock->ssl, buf, len ) :
 #endif
@@ -400,7 +403,10 @@ socket_read( Socket_t *sock, char *buf, int len )
 static int
 socket_write( Socket_t *sock, char *buf, int len )
 {
-       int n =
+       int n;
+
+       assert( sock->fd >= 0 );
+       n =
 #if HAVE_LIBSSL
                sock->use_ssl ? SSL_write( sock->ssl, buf, len ) :
 #endif

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to