commit - f179070113dd04340b41b18efe9227dd5af40d99
commit + 29bd35bc4fa858f0ed36e39a3d00830859ce22c8
blob - 37c5c3819a49390a298bfcb80a33b7919595d1f8
blob + e3f88011b178731f8a2e4c70ab2d82e4dfd09622
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2003 by Alexander Barton (alex@barton.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "portab.h"
-static char UNUSED id[] = "$Id: conn.c,v 1.116 2003/02/21 19:19:27 alex Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.117 2003/02/23 12:04:05 alex Exp $";
#include "imp.h"
#include <assert.h>
#include "parse.h"
#include "tool.h"
+#ifdef RENDEZVOUS
+#include "rendezvous.h"
+#endif
+
#include "exp.h"
CONN_ID idx;
INT i;
- /* Sockets schliessen */
Log( LOG_DEBUG, "Shutting down all connections ..." );
+
+#ifdef RENDEZVOUS
+ Rendezvous_UnregisterListeners( );
+#endif
+
+ /* Sockets schliessen */
for( i = 0; i < Conn_MaxFD + 1; i++ )
{
if( FD_ISSET( i, &My_Sockets ))
INT i;
+#ifdef RENDEZVOUS
+ Rendezvous_UnregisterListeners( );
+#endif
+
Log( LOG_INFO, "Shutting down all listening sockets ..." );
for( i = 0; i < Conn_MaxFD + 1; i++ )
{
struct sockaddr_in addr;
INT sock;
-
+#ifdef RENDEZVOUS
+ CHAR name[CLIENT_ID_LEN], *info;
+#endif
+
/* Server-"Listen"-Socket initialisieren */
memset( &addr, 0, sizeof( addr ));
addr.sin_family = AF_INET;
if( sock > Conn_MaxFD ) Conn_MaxFD = sock;
Log( LOG_INFO, "Now listening on port %d (socket %d).", Port, sock );
+
+#ifdef RENDEZVOUS
+ /* Get best server description text */
+ if( ! Conf_ServerInfo[0] ) info = Conf_ServerName;
+ else
+ {
+ /* Use server info string */
+ info = NULL;
+ if( Conf_ServerInfo[0] == '[' )
+ {
+ /* Cut off leading hostname part in "[]" */
+ info = strchr( Conf_ServerInfo, ']' );
+ if( info )
+ {
+ info++;
+ while( *info == ' ' ) info++;
+ }
+ }
+ if( ! info ) info = Conf_ServerInfo;
+ }
+ /* Add port number to description if non-standard */
+ if( Port != 6667 ) snprintf( name, sizeof( name ), "%s (port %u)", info, Port );
+ else strlcpy( name, info, sizeof( name ));
+
+ /* Register service */
+ Rendezvous_Register( name, RENDEZVOUS_TYPE, Port );
+#endif
+
return TRUE;
} /* Conn_NewListener */
while(( ! NGIRCd_SignalQuit ) && ( ! NGIRCd_SignalRestart ))
{
timeout = TRUE;
+
+#ifdef RENDEZVOUS
+ Rendezvous_Handler( );
+#endif
/* Should the configuration be reloaded? */
if( NGIRCd_SignalRehash ) NGIRCd_Rehash( );
blob - e800117948347d4c61d3c118f22405303042da7d
blob + 3b794b4a94df151fdb57a2aa710316df66d962b2
--- src/ngircd/ngircd.c
+++ src/ngircd/ngircd.c
#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.72 2003/02/23 12:04:05 alex Exp $";
#include "imp.h"
#include <assert.h>
#include "log.h"
#include "parse.h"
#include "irc.h"
+
+#ifdef RENDEZVOUS
+#include "rendezvous.h"
+#endif
#include "exp.h"
#include "ngircd.h"
Lists_Init( );
Channel_Init( );
Client_Init( );
+#ifdef RENDEZVOUS
+ Rendezvous_Init( );
+#endif
Conn_Init( );
/* Wenn als root ausgefuehrt und eine andere UID
/* Alles abmelden */
Conn_Exit( );
+#ifdef RENDEZVOUS
+ Rendezvous_Exit( );
+#endif
Client_Exit( );
Channel_Exit( );
Lists_Exit( );
if( txt[0] ) strcat( txt, "+" );
strcat( txt, "IRCPLUS" );
#endif
+#ifdef RENDEZVOUS
+ if( txt[0] ) strcat( txt, "+" );
+ strcat( txt, "RENDEZVOUS" );
+#endif
if( txt[0] ) strlcat( txt, "-", sizeof( txt ));
strlcat( txt, TARGET_CPU, sizeof( txt ));