about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2009-02-04 23:23:12 +0100
committerFlorian Westphal <fw@strlen.de>2009-02-04 23:23:12 +0100
commit2fce4667a86e42589db8dd84a51c472aa18ac80e (patch)
tree23b9aa634a1dda4049f97c6c5fd66454d86e0a93
parentc6a43fbaf0579741ebf34e88ca7f0586b471062e (diff)
downloadngircd-2fce4667a86e42589db8dd84a51c472aa18ac80e.tar.gz
ngircd-2fce4667a86e42589db8dd84a51c472aa18ac80e.zip
SSL/TLS: clear all ssl realted flags on shutdown
one ssl related flags was not cleared on ssl shutdown.
introduce and use CONN_SSL_FLAGS_ALL to zap them all.
-rw-r--r--src/ngircd/conn-ssl.c3
-rw-r--r--src/ngircd/conn.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/ngircd/conn-ssl.c b/src/ngircd/conn-ssl.c
index dc165d79..1b4da3ce 100644
--- a/src/ngircd/conn-ssl.c
+++ b/src/ngircd/conn-ssl.c
@@ -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);
 }
 
 
diff --git a/src/ngircd/conn.h b/src/ngircd/conn.h
index bd332b63..450d3d10 100644
--- a/src/ngircd/conn.h
+++ b/src/ngircd/conn.h
@@ -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;