]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
- Logging bei Timeout von Verbindungen geaendert.
[ngircd-alex.git] / src / ngircd / conn.c
index 710abac70f849a2c0b58c36c3a72bcf617bc12b6..b67d71365a086705f309123cf7f5145ac727e9ee 100644 (file)
@@ -9,11 +9,26 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: conn.c,v 1.36 2002/02/11 01:00:50 alex Exp $
+ * $Id: conn.c,v 1.41 2002/02/27 14:47:04 alex Exp $
  *
  * connect.h: Verwaltung aller Netz-Verbindungen ("connections")
  *
  * $Log: conn.c,v $
+ * Revision 1.41  2002/02/27 14:47:04  alex
+ * - Logging bei Timeout von Verbindungen geaendert.
+ *
+ * Revision 1.40  2002/02/27 02:26:23  alex
+ * - an Conn_Close() werden zwei weitere Fehlermeldungen zum Forwarden uebergeben.
+ *
+ * Revision 1.39  2002/02/23 00:03:54  alex
+ * - Ergebnistyp von Conn_GetIdle() und Conn_LastPing() auf "time_t" geaendert.
+ *
+ * Revision 1.38  2002/02/19 20:34:31  alex
+ * - Bei ausgehenden Verbindungen wird der Ziel-Port ins Log geschrieben.
+ *
+ * Revision 1.37  2002/02/19 20:05:37  alex
+ * - "Passive-Mode" implementiert: kein Auto-Conect zu anderen Servern.
+ *
  * Revision 1.36  2002/02/11 01:00:50  alex
  * - neue Funktion Conn_LastPing().
  *
@@ -564,7 +579,7 @@ GLOBAL VOID Conn_UpdateIdle( CONN_ID Idx )
 }
 
 
-GLOBAL INT32 Conn_GetIdle( CONN_ID Idx )
+GLOBAL time_t Conn_GetIdle( CONN_ID Idx )
 {
        /* Idle-Time einer Verbindung liefern (in Sekunden) */
 
@@ -573,7 +588,7 @@ GLOBAL INT32 Conn_GetIdle( CONN_ID Idx )
 } /* Conn_GetIdle */
 
 
-GLOBAL INT32 Conn_LastPing( CONN_ID Idx )
+GLOBAL time_t Conn_LastPing( CONN_ID Idx )
 {
        /* Zeitpunkt des letzten PING liefern */
 
@@ -775,7 +790,7 @@ LOCAL VOID Read_Request( CONN_ID Idx )
        {
                /* Socket wurde geschlossen */
                Log( LOG_INFO, "%s:%d is closing the connection ...", inet_ntoa( My_Connections[Idx].addr.sin_addr ), ntohs( My_Connections[Idx].addr.sin_port));
-               Conn_Close( Idx, "Socket closed.", NULL, FALSE );
+               Conn_Close( Idx, NULL, "Client closed connection.", FALSE );
                return;
        }
 
@@ -783,7 +798,7 @@ LOCAL VOID Read_Request( CONN_ID Idx )
        {
                /* Fehler beim Lesen */
                Log( LOG_ERR, "Read error on connection %d: %s!", Idx, strerror( errno ));
-               Conn_Close( Idx, "Read error!", NULL, FALSE );
+               Conn_Close( Idx, NULL, "Read error!", FALSE );
                return;
        }
 
@@ -894,7 +909,7 @@ LOCAL VOID Check_Connections( VOID )
                        if( My_Connections[i].lastdata < time( NULL ) - Conf_PingTimeout )
                        {
                                /* Timeout */
-                               Log( LOG_INFO, "Connection %d: Timeout.", i );
+                               Log( LOG_DEBUG, "Connection %d timed out ...", i );
                                Conn_Close( i, NULL, "Timeout", TRUE );
                        }
                }
@@ -909,6 +924,9 @@ LOCAL VOID Check_Servers( VOID )
 
        INT idx, i, n;
        RES_STAT *s;
+
+       /* Wenn "Passive-Mode" aktiv: nicht verbinden */
+       if( NGIRCd_Passive ) return;
        
        for( i = 0; i < Conf_Server_Count; i++ )
        {
@@ -986,7 +1004,7 @@ LOCAL VOID New_Server( INT Server, CONN_ID Idx )
                return;
        }
        
-       Log( LOG_INFO, "Establishing connection to \"%s\", %s (connection %d) ... ", Conf_Server[Server].host, Conf_Server[Server].ip, Idx );
+       Log( LOG_INFO, "Establishing connection to \"%s\", %s, port %d (connection %d) ... ", Conf_Server[Server].host, Conf_Server[Server].ip, Conf_Server[Server].port, Idx );
 
        if( inet_aton( Conf_Server[Server].ip, &inaddr ) == 0 )
        {