]> arthur.barton.de Git - ngircd-alex.git/commitdiff
SSL/TLS: clear all ssl realted flags on shutdown
authorFlorian Westphal <fw@strlen.de>
Wed, 4 Feb 2009 22:23:12 +0000 (23:23 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 4 Feb 2009 22:23:12 +0000 (23:23 +0100)
one ssl related flags was not cleared on ssl shutdown.
introduce and use CONN_SSL_FLAGS_ALL to zap them all.

src/ngircd/conn-ssl.c
src/ngircd/conn.h

index dc165d79eed41ddc2908174add836ebee1f746fd..1b4da3ce047695a99456f58533a6335631940554 100644 (file)
@@ -228,7 +228,8 @@ void ConnSSL_Free(CONNECTION *c)
        }
 #endif
        assert(Conn_OPTION_ISSET(c, CONN_SSL));
-       Conn_OPTION_DEL(c, (CONN_SSL_CONNECT|CONN_SSL|CONN_SSL_WANT_WRITE));
+       /* can't just set bitmask to 0 -- there are other, non-ssl related flags, e.g. CONN_ZIP. */
+       Conn_OPTION_DEL(c, CONN_SSL_FLAGS_ALL);
 }
 
 
index bd332b63b394ef01cc989fcc1b580b419d4d8e9b..450d3d10497c7fffbff4fdf013ff2b680156fa1c 100644 (file)
@@ -39,6 +39,7 @@
 #define CONN_SSL               32      /* this connection is SSL encrypted */
 #define CONN_SSL_WANT_WRITE    64      /* SSL/TLS library needs to write protocol data */
 #define CONN_SSL_WANT_READ     128     /* SSL/TLS library needs to read protocol data */
+#define CONN_SSL_FLAGS_ALL     (CONN_SSL_CONNECT|CONN_SSL|CONN_SSL_WANT_WRITE|CONN_SSL_WANT_READ)
 #endif
 typedef int CONN_ID;