]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
- Manual Page aktualisiert.
[ngircd-alex.git] / src / ngircd / conn.c
index 07e51fb4a9d67f6b90d2af08722f4a92f932bb57..d3df6ce687e1eb0f146b0fb4a76b84905502e2c8 100644 (file)
@@ -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.54 2002/03/12 23:45:30 alex Exp $
+ * $Id: conn.c,v 1.60 2002/03/30 13:40:56 alex Exp $
  *
  * connect.h: Verwaltung aller Netz-Verbindungen ("connections")
  */
@@ -163,7 +163,7 @@ GLOBAL VOID Conn_Exit( VOID )
 } /* Conn_Exit */
 
 
-GLOBAL BOOLEAN Conn_NewListener( CONST INT Port )
+GLOBAL BOOLEAN Conn_NewListener( CONST UINT Port )
 {
        /* Neuen Listen-Socket erzeugen: der Server wartet dann auf
         * dem angegebenen Port auf Verbindungen. Kann der Listen-
@@ -332,6 +332,10 @@ GLOBAL BOOLEAN Conn_WriteStr( CONN_ID Idx, CHAR *Format, ... )
        BOOLEAN ok;
        va_list ap;
 
+       assert( Idx >= 0 );
+       assert( My_Connections[Idx].sock > NONE );
+       assert( Format != NULL );
+       
        va_start( ap, Format );
        if( vsnprintf( buffer, COMMAND_LEN - 2, Format, ap ) == COMMAND_LEN - 2 )
        {
@@ -805,7 +809,7 @@ LOCAL VOID Check_Connections( VOID )
                                if( My_Connections[i].lastping < time( NULL ) - Conf_PongTimeout )
                                {
                                        /* Timeout */
-                                       Log( LOG_DEBUG, "Connection %d: Ping timeout.", i );
+                                       Log( LOG_DEBUG, "Connection %d: Ping timeout: %d seconds.", i, Conf_PongTimeout );
                                        Conn_Close( i, NULL, "Ping timeout", TRUE );
                                }
                        }
@@ -1009,12 +1013,14 @@ LOCAL BOOLEAN Init_Socket( INT Sock )
 
        INT on = 1;
 
+#ifdef O_NONBLOCK      /* A/UX kennt das nicht? */
        if( fcntl( Sock, F_SETFL, O_NONBLOCK ) != 0 )
        {
                Log( LOG_CRIT, "Can't enable non-blocking mode: %s!", strerror( errno ));
                close( Sock );
                return FALSE;
        }
+#endif
        if( setsockopt( Sock, SOL_SOCKET, SO_REUSEADDR, &on, (socklen_t)sizeof( on )) != 0)
        {
                Log( LOG_ERR, "Can't set socket options: %s!", strerror( errno ));