* 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.45 2002/03/02 02:44:01 alex Exp $
+ * $Id: conn.c,v 1.48 2002/03/10 17:50:48 alex Exp $
*
* connect.h: Verwaltung aller Netz-Verbindungen ("connections")
*
* $Log: conn.c,v $
+ * Revision 1.48 2002/03/10 17:50:48 alex
+ * - Handling von "--version" und "--help" nochmal geaendert ...
+ *
+ * Revision 1.47 2002/03/04 23:16:23 alex
+ * - Logging geaendert: detaillierter im Syslog, "allgemeiner" fuer Clients.
+ *
+ * Revision 1.46 2002/03/02 03:32:08 alex
+ * - Aenderung des Idle-Verhalten revidiert: das war ein Schnellschuss :-/
+ *
* Revision 1.45 2002/03/02 02:44:01 alex
* - Timeouts ausgehender Verbindungen werden besser erkannt (z.B. unter Cygwin).
* - Idle-Time der Hauptschleife [Conn_Handle()] erhoeht: weniger Last.
Check_Connections( );
/* Timeout initialisieren */
- tv.tv_sec = 2;
- tv.tv_usec = 0;
+ tv.tv_sec = 0;
+ tv.tv_usec = 50000;
/* noch volle Lese-Buffer suchen */
for( i = 0; i < MAX_CONNECTIONS; i++ )
{
/* 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, NULL, "Client closed connection.", FALSE );
+ Conn_Close( Idx, "Socket closed!", "Client closed connection", FALSE );
return;
}
{
/* Fehler beim Lesen */
Log( LOG_ERR, "Read error on connection %d: %s!", Idx, strerror( errno ));
- Conn_Close( Idx, NULL, "Read error!", FALSE );
+ Conn_Close( Idx, "Read error!", "Client closed connection", FALSE );
return;
}
/* Haben wir schon eine Verbindung? */
for( n = 0; n < MAX_CONNECTIONS; n++ )
{
+ /* Verbindung zu diesem Server? */
if(( My_Connections[n].sock != NONE ) && ( My_Connections[n].our_server == i ))
{
/* Komplett aufgebaute Verbindung? */
/* IP schon aufgeloest? */
if( My_Connections[n].res_stat == NULL ) New_Server( i, n );
}
+
+ /* Verbindung in dieser Server-Gruppe? */
+ if(( My_Connections[n].sock != NONE ) && ( My_Connections[n].our_server != NONE ))
+ {
+ if( Conf_Server[n].group == Conf_Server[i].group != NONE ) break;
+ }
}
if( n < MAX_CONNECTIONS ) continue;
My_Connections[Idx].rdatalen = 0;
My_Connections[Idx].wbuf[0] = '\0';
My_Connections[Idx].wdatalen = 0;
- My_Connections[Idx].our_server = -1;
+ My_Connections[Idx].our_server = NONE;
My_Connections[Idx].lastdata = time( NULL );
My_Connections[Idx].lastping = 0;
My_Connections[Idx].lastprivmsg = time( NULL );