about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2002-09-07 22:34:44 +0000
committerAlexander Barton <alex@barton.de>2002-09-07 22:34:44 +0000
commit8a927a1b6aa95e716948aa21ed591381a2676ffc (patch)
tree399b28e0deb9db922f6ea5e6b6756567299dfa61
parenteab10c91b795af65bbeb9004354f9686a7bc49f1 (diff)
downloadngircd-8a927a1b6aa95e716948aa21ed591381a2676ffc.tar.gz
ngircd-8a927a1b6aa95e716948aa21ed591381a2676ffc.zip
- Penalty-Delays gelten nun auch für Schreibvorgaenge.
- Conn_Handler() besser strukturiert ...
-rw-r--r--src/ngircd/conn.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 3e2ca2fa..76b0822b 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -9,7 +9,7 @@
  * 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.71 2002/09/07 21:35:06 alex Exp $
+ * $Id: conn.c,v 1.72 2002/09/07 22:34:44 alex Exp $
  *
  * connect.h: Verwaltung aller Netz-Verbindungen ("connections")
  */
@@ -289,6 +289,7 @@ Conn_Handler( VOID )
 			{
 				/* Fuer die Verbindung ist eine "Penalty-Zeit" gesetzt */
 				FD_CLR( My_Connections[i].sock, &read_sockets );
+				FD_CLR( My_Connections[i].sock, &write_sockets );
 			}
 		}
 		for( i = 0; i < Conn_MaxFD + 1; i++ )
@@ -305,15 +306,22 @@ Conn_Handler( VOID )
 		tv.tv_usec = 0;
 		
 		/* Auf Aktivitaet warten */
-		if( select( Conn_MaxFD + 1, &read_sockets, &write_sockets, NULL, &tv ) == -1 )
+		i = select( Conn_MaxFD + 1, &read_sockets, &write_sockets, NULL, &tv );
+		if( i == 0 )
 		{
+			/* keine Veraenderung an den Sockets */
+			continue;
+		}
+		if( i == -1 )
+		{
+			/* Fehler (z.B. Interrupt) */
 			if( errno != EINTR )
 			{
 				Log( LOG_EMERG, "select(): %s!", strerror( errno ));
 				Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
 				exit( 1 );
 			}
-			if(( ! NGIRCd_Quit ) && ( ! NGIRCd_Restart )) continue;
+			continue;
 		}
 
 		/* Koennen Daten geschrieben werden? */