]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/ngircd.c
Fixed a compiler warning related to an unnecessary assert().
[ngircd-alex.git] / src / ngircd / ngircd.c
index e800117948347d4c61d3c118f22405303042da7d..313dc456df6960de53553971fe96f0de4bdfb56b 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: ngircd.c,v 1.71 2003/01/01 13:32:23 alex Exp $";
+static char UNUSED id[] = "$Id: ngircd.c,v 1.77 2003/06/05 10:48:13 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -43,6 +43,10 @@ static char UNUSED id[] = "$Id: ngircd.c,v 1.71 2003/01/01 13:32:23 alex Exp $";
 #include "parse.h"
 #include "irc.h"
 
+#ifdef RENDEZVOUS
+#include "rendezvous.h"
+#endif
+
 #include "exp.h"
 #include "ngircd.h"
 
@@ -182,8 +186,8 @@ main( int argc, const char *argv[] )
 
                                if( ! ok )
                                {
-                                       printf( "%s: invalid option \"-%c\"!\n", PACKAGE, argv[i][n] );
-                                       printf( "Try \"%s --help\" for more information.\n", PACKAGE );
+                                       printf( "%s: invalid option \"-%c\"!\n", PACKAGE_NAME, argv[i][n] );
+                                       printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
                                        exit( 1 );
                                }
                        }
@@ -191,8 +195,8 @@ main( int argc, const char *argv[] )
                }
                if( ! ok )
                {
-                       printf( "%s: invalid option \"%s\"!\n", PACKAGE, argv[i] );
-                       printf( "Try \"%s --help\" for more information.\n", PACKAGE );
+                       printf( "%s: invalid option \"%s\"!\n", PACKAGE_NAME, argv[i] );
+                       printf( "Try \"%s --help\" for more information.\n", PACKAGE_NAME );
                        exit( 1 );
                }
        }
@@ -235,7 +239,7 @@ main( int argc, const char *argv[] )
                        if( pid < 0 )
                        {
                                /* Fehler */
-                               printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE, strerror( errno ));
+                               printf( "%s: Can't fork: %s!\nFatal error, exiting now ...\n", PACKAGE_NAME, strerror( errno ));
                                exit( 1 );
                        }
 
@@ -258,6 +262,9 @@ main( int argc, const char *argv[] )
                Lists_Init( );
                Channel_Init( );
                Client_Init( );
+#ifdef RENDEZVOUS
+               Rendezvous_Init( );
+#endif
                Conn_Init( );
 
                /* Wenn als root ausgefuehrt und eine andere UID
@@ -290,13 +297,13 @@ main( int argc, const char *argv[] )
                 * beim PASS-Befehl verwendete Syntax sowie die erweiterten Flags
                 * sind in doc/Protocol.txt beschrieben. */
 #ifdef IRCPLUS
-               sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGEVERSION, IRCPLUSFLAGS );
+               sprintf( NGIRCd_ProtoID, "%s%s %s|%s:%s", PROTOVER, PROTOIRCPLUS, PACKAGE_NAME, PACKAGE_VERSION, IRCPLUSFLAGS );
 #ifdef USE_ZLIB
                strcat( NGIRCd_ProtoID, "Z" );
 #endif
                if( Conf_OperCanMode ) strcat( NGIRCd_ProtoID, "o" );
 #else
-               sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGEVERSION );
+               sprintf( NGIRCd_ProtoID, "%s%s %s|%s", PROTOVER, PROTOIRC, PACKAGE_NAME, PACKAGE_VERSION );
 #endif
                strcat( NGIRCd_ProtoID, " P" );
 #ifdef USE_ZLIB
@@ -311,7 +318,7 @@ main( int argc, const char *argv[] )
                if( Conn_InitListeners( ) < 1 )
                {
                        Log( LOG_ALERT, "Server isn't listening on a single port!" );
-                       Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE );
+                       Log( LOG_ALERT, "%s exiting due to fatal errors!", PACKAGE_NAME );
                        exit( 1 );
                }
                
@@ -320,6 +327,9 @@ main( int argc, const char *argv[] )
 
                /* Alles abmelden */
                Conn_Exit( );
+#ifdef RENDEZVOUS
+               Rendezvous_Exit( );
+#endif
                Client_Exit( );
                Channel_Exit( );
                Lists_Exit( );
@@ -336,9 +346,9 @@ NGIRCd_Version( VOID )
        STATIC CHAR version[126];
        
 #ifdef CVSDATE
-       sprintf( version, "%s %s(%s)-%s", PACKAGEVERSION, CVSDATE, NGIRCd_VersionAddition( ));
+       sprintf( version, "%s %s(%s)-%s", PACKAGE_NAME, PACKAGE_VERSION, CVSDATE, NGIRCd_VersionAddition( ));
 #else
-       sprintf( version, "%s %s-%s", PACKAGEVERSION, NGIRCd_VersionAddition( ));
+       sprintf( version, "%s %s-%s", PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_VersionAddition( ));
 #endif
        return version;
 } /* NGIRCd_Version */
@@ -347,7 +357,7 @@ NGIRCd_Version( VOID )
 GLOBAL CHAR *
 NGIRCd_VersionAddition( VOID )
 {
-       STATIC CHAR txt[64];
+       STATIC CHAR txt[200];
 
        strcpy( txt, "" );
 
@@ -359,6 +369,14 @@ NGIRCd_VersionAddition( VOID )
        if( txt[0] ) strcat( txt, "+" );
        strcat( txt, "ZLIB" );
 #endif
+#ifdef USE_TCPWRAP
+       if( txt[0] ) strcat( txt, "+" );
+       strcat( txt, "TCPWRAP" );
+#endif
+#ifdef RENDEZVOUS
+       if( txt[0] ) strcat( txt, "+" );
+       strcat( txt, "RENDEZVOUS" );
+#endif
 #ifdef DEBUG
        if( txt[0] ) strcat( txt, "+" );
        strcat( txt, "DEBUG" );
@@ -399,7 +417,9 @@ NGIRCd_Rehash( VOID )
        Conn_ExitListeners( );
 
        /* Alten Server-Namen merken */
+#ifdef DEBUG
        assert( sizeof( old_name ) == sizeof( Conf_ServerName ));
+#endif
        strcpy( old_name, Conf_ServerName );
 
        /* Konfiguration neu lesen ... */
@@ -419,6 +439,9 @@ NGIRCd_Rehash( VOID )
        /* Listen-Sockets neu anlegen: */
        Conn_InitListeners( );
 
+       /* Sync configuration with established connections */
+       Conn_SyncServerStruct( );
+
        Log( LOG_NOTICE|LOG_snotice, "Re-reading of configuration done." );
 } /* NGIRCd_Rehash */