about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2009-12-30 23:42:43 +0100
committerAlexander Barton <alex@barton.de>2009-12-30 23:42:43 +0100
commit1b73e68e6eb82693c4821758879ae632aff3664f (patch)
tree28bfa346768b34af9fc84301c22b3ba9de05da8e
parent03cde2efd3044a226b94b72810113080a3250d05 (diff)
downloadngircd-1b73e68e6eb82693c4821758879ae632aff3664f.tar.gz
ngircd-1b73e68e6eb82693c4821758879ae632aff3664f.zip
Move NewConnection handling from callbacks to New_Connection()
-rw-r--r--src/ngircd/conn.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 7b07114b..e82b717a 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -124,9 +124,7 @@ static void
 cb_listen(int sock, short irrelevant)
 {
 	(void) irrelevant;
-	if (New_Connection( sock ) >= 0)
-		NumConnections++;
-	LogDebug("Total number of connections now %ld.", NumConnections);
+	(void) New_Connection(sock);
 }
 
 
@@ -146,9 +144,6 @@ cb_listen_ssl(int sock, short irrelevant)
 	fd = New_Connection(sock);
 	if (fd < 0)
 		return;
-
-	NumConnections++;
-	LogDebug("Total number of connections now %ld.", NumConnections);
 	io_event_setcb(My_Connections[fd].sock, cb_clientserver_ssl);
 }
 #endif
@@ -1361,6 +1356,9 @@ New_Connection(int Sock)
 	 * DNS and IDENT resolver subprocess using the "penalty" mechanism.
 	 * If there are results earlier, the delay is aborted. */
 	Conn_SetPenalty(new_sock, 4);
+
+	NumConnections++;
+	LogDebug("Total number of connections now %ld.", NumConnections);
 	return new_sock;
 } /* New_Connection */