about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2002-11-23 16:09:57 +0000
committerAlexander Barton <alex@barton.de>2002-11-23 16:09:57 +0000
commit22b7b07932e282b5edd90d25d6da7262bfb3feda (patch)
tree84157f7266f6516333975719f6356a1803464229 /src
parent57bc0d78959e7037b98d6bc8f6a02d941744b9eb (diff)
downloadngircd-22b7b07932e282b5edd90d25d6da7262bfb3feda.tar.gz
ngircd-22b7b07932e282b5edd90d25d6da7262bfb3feda.zip
- select() in Try_Write() hat falschen (keinen!) Timeout verwendet;
- der Timeout fuer das select() in Conn_Handler() ist nun TIME_RES (=2).
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conn.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 85a9966b..d54c382c 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.93 2002/11/22 17:58:19 alex Exp $
+ * $Id: conn.c,v 1.94 2002/11/23 16:09:57 alex Exp $
  *
  * connect.h: Verwaltung aller Netz-Verbindungen ("connections")
  */
@@ -363,8 +363,7 @@ Conn_Handler( VOID )
 		}
 
 		/* Timeout initialisieren */
-		tv.tv_sec = 1;
-		tv.tv_usec = 0;
+		tv.tv_sec = TIME_RES; tv.tv_usec = 0;
 		
 		/* Auf Aktivitaet warten */
 		i = select( Conn_MaxFD + 1, &read_sockets, &write_sockets, NULL, &tv );
@@ -716,14 +715,18 @@ Try_Write( CONN_ID Idx )
 	 * Socket zu schreiben. */
 
 	fd_set write_socket;
+	struct timeval tv;
 
 	assert( Idx > NONE );
 	assert( My_Connections[Idx].sock > NONE );
 	assert( My_Connections[Idx].wdatalen > 0 );
 
+	/* Timeout initialisieren: 0 Sekunden, also nicht blockieren */
+	tv.tv_sec = 0; tv.tv_usec = 0;
+
 	FD_ZERO( &write_socket );
 	FD_SET( My_Connections[Idx].sock, &write_socket );
-	if( select( My_Connections[Idx].sock + 1, NULL, &write_socket, NULL, 0 ) == -1 )
+	if( select( My_Connections[Idx].sock + 1, NULL, &write_socket, NULL, &tv ) == -1 )
 	{
 		/* Fehler! */
 		if( errno != EINTR )