]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
New configuration option "NoIdent" to disable IDENT lookups
[ngircd-alex.git] / src / ngircd / conn.c
index 0b21d3a12b66e27fdfd392f20b235e19ba6a9d7d..b29ad7e353dbb5042d94db35f97798b0ef26bb07 100644 (file)
@@ -116,6 +116,7 @@ cb_listen(int sock, short irrelevant)
        (void) irrelevant;
        if (New_Connection( sock ) >= 0)
                NumConnections++;
+       LogDebug("Total number of connections now %ld.", NumConnections);
 }
 
 
@@ -130,6 +131,7 @@ cb_listen_ssl(int sock, short irrelevant)
                return;
 
        NumConnections++;
+       LogDebug("Total number of connections now %ld.", NumConnections);
        io_event_setcb(My_Connections[fd].sock, cb_clientserver_ssl);
 }
 #endif
@@ -1035,7 +1037,8 @@ Conn_Close( CONN_ID Idx, char *LogMsg, char *FwdMsg, bool InformClient )
        assert(NumConnections > 0);
        if (NumConnections)
                NumConnections--;
-       LogDebug("Shutdown of connection %d completed", Idx );
+       LogDebug("Shutdown of connection %d completed, %ld connection%s left.",
+                Idx, NumConnections, NumConnections != 1 ? "s" : "");
 } /* Conn_Close */
 
 
@@ -1164,7 +1167,7 @@ New_Connection( int Sock )
 #endif
        ng_ipaddr_t new_addr;
        char ip_str[NG_INET_ADDRSTRLEN];
-       int new_sock, new_sock_len;
+       int new_sock, new_sock_len, identsock;
        CLIENT *c;
        long cnt;
 
@@ -1267,10 +1270,14 @@ New_Connection( int Sock )
 
        Client_SetHostname(c, My_Connections[new_sock].host);
 
+       identsock = new_sock;
+#ifdef IDENTAUTH
+       if (Conf_NoIdent)
+               identsock = -1;
+#endif
        if (!Conf_NoDNS)
                Resolve_Addr(&My_Connections[new_sock].res_stat, &new_addr,
-                       My_Connections[new_sock].sock, cb_Read_Resolver_Result);
-
+                            identsock, cb_Read_Resolver_Result);
        Conn_SetPenalty(new_sock, 4);
        return new_sock;
 } /* New_Connection */
@@ -1717,8 +1724,9 @@ New_Server( int Server , ng_ipaddr_t *dest)
                Conf_Server[Server].conn_id = NONE;
        }
 #endif
-       LogDebug("Registered new connection %d on socket %d.",
-                               new_sock, My_Connections[new_sock].sock );
+       NumConnections++;
+       LogDebug("Registered new connection %d on socket %d (%ld in total).",
+                new_sock, My_Connections[new_sock].sock, NumConnections);
        Conn_OPTION_ADD( &My_Connections[new_sock], CONN_ISCONNECTING );
 } /* New_Server */