mirror of
https://github.com/osmarks/ngircd.git
synced 2025-10-27 03:57:38 +00:00
Compare commits
22 Commits
rel-0-9-0
...
branch-0-9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab1e81841b | ||
|
|
957cdda1c0 | ||
|
|
c35b810b90 | ||
|
|
3179bd3090 | ||
|
|
f95d813064 | ||
|
|
a854a38616 | ||
|
|
51b22759b6 | ||
|
|
521782ad05 | ||
|
|
84e23f09fc | ||
|
|
4429afe3c2 | ||
|
|
216eb30c73 | ||
|
|
ff91c6db38 | ||
|
|
a8d50a1ee4 | ||
|
|
7962ba5fe0 | ||
|
|
04766b8f3d | ||
|
|
2019324741 | ||
|
|
99e718eff9 | ||
|
|
61776e9a57 | ||
|
|
eccf4ea5f2 | ||
|
|
914fbac0f1 | ||
|
|
b6ce4ce002 | ||
|
|
1246ec04b8 |
19
ChangeLog
19
ChangeLog
@@ -10,6 +10,23 @@
|
||||
-- ChangeLog --
|
||||
|
||||
|
||||
ngIRCd 0.9.2 (2005-10-15)
|
||||
|
||||
- Fixed a bug that could cause the damon to crash when outgoing server
|
||||
connections can't be established.
|
||||
- Fixed a bug that caused the daemon to leak file descriptors when no
|
||||
resolver subprocesses could be created.
|
||||
- Fixed server NOTICEs to users with "s" mode ("server messages").
|
||||
- Fixed a format string bug in "connection statistics" messages to clients.
|
||||
|
||||
ngIRCd 0.9.1 (2005-08-03)
|
||||
|
||||
- The KILL command killed much more than desired (including server links!)
|
||||
when the target user is connected to a remote server. Bug introduced in
|
||||
ngIRCd 0.9.0 ... Reported by <qssl@fastmail.fm>, Thanks!
|
||||
- Changed some constants to be "signed" (instead of unsigned) to solve
|
||||
problems with old (pre-ANSI) compilers.
|
||||
|
||||
ngIRCd 0.9.0 (2005-07-24)
|
||||
|
||||
ngIRCd 0.9.0-pre1 (2005-07-09)
|
||||
@@ -612,4 +629,4 @@ ngIRCd 0.0.1, 31.12.2001
|
||||
|
||||
|
||||
--
|
||||
$Id: ChangeLog,v 1.276.2.5 2005/07/24 21:39:45 alex Exp $
|
||||
$Id: ChangeLog,v 1.276.2.12 2005/10/15 12:44:08 alex Exp $
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
# (at your option) any later version.
|
||||
# Please read the file COPYING, README and AUTHORS for more information.
|
||||
#
|
||||
# $Id: configure.in,v 1.111.2.3 2005/07/24 21:14:19 alex Exp $
|
||||
# $Id: configure.in,v 1.111.2.6 2005/10/15 12:44:08 alex Exp $
|
||||
#
|
||||
|
||||
# -- Initialisation --
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(ngircd, 0.9.0)
|
||||
AC_INIT(ngircd, 0.9.2)
|
||||
AC_CONFIG_SRCDIR(src/ngircd/ngircd.c)
|
||||
AC_CANONICAL_TARGET
|
||||
AM_INIT_AUTOMAKE(1.6)
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
ngircd (0.9.2-0ab1) stable; urgency=low
|
||||
|
||||
* New "upstream release" fixing a few bugs in 0.9.1.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Sat, 15 Oct 2005 14:10:34 +0200
|
||||
|
||||
ngircd (0.9.1-0ab1) unstable; urgency=medium
|
||||
|
||||
* New "upstream release" addressing two problems in ngIRCd 0.9.0.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Wed, 3 Aug 2005 15:10:41 +0200
|
||||
|
||||
ngircd (0.9.0-0ab2) unstable; urgency=medium
|
||||
|
||||
* Init script: fixed a problem with symbolic links in runlevel directories
|
||||
that could prevent the init script from working correctly.
|
||||
|
||||
-- Alexander Barton <alex@barton.de> Tue, 26 Jul 2005 21:31:18 +0200
|
||||
|
||||
ngircd (0.9.0-0ab1) unstable; urgency=low
|
||||
|
||||
* New "upstream release".
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# ngIRCd start and stop script for Debian-based systems
|
||||
#
|
||||
# $Id: ngircd.init,v 1.5 2005/06/01 21:51:11 alex Exp $
|
||||
# $Id: ngircd.init,v 1.5.2.1 2005/07/26 19:30:54 alex Exp $
|
||||
#
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
@@ -11,7 +11,8 @@ NAME=ngIRCd
|
||||
DESC="IRC daemon"
|
||||
PARAMS=""
|
||||
|
||||
test -h "$0" && BASENAME=`readlink $0` || BASENAME=`basename $0`
|
||||
test -h "$0" && me=`readlink $0` || me="$0"
|
||||
BASENAME=`basename $me`
|
||||
|
||||
test -f /etc/default/$BASENAME && . /etc/default/$BASENAME
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
%define name ngircd
|
||||
%define version 0.9.0
|
||||
%define version 0.9.2
|
||||
%define release 1
|
||||
%define prefix %{_prefix}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: client.c,v 1.84 2005/06/12 16:39:42 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: client.c,v 1.84.2.1 2006/03/24 23:30:34 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -296,11 +296,9 @@ Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit )
|
||||
{
|
||||
if( c->id[0] ) Log( LOG_NOTICE, "Client \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
|
||||
else Log( LOG_NOTICE, "Client unregistered (connection %d): %s", c->conn_id, txt );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( c->id[0] ) Log( LOG_WARNING, "Unregistered unknown client \"%s\": %s", c->id, txt );
|
||||
else Log( LOG_WARNING, "Unregistered unknown client: %s", c->id, txt );
|
||||
} else {
|
||||
Log(LOG_WARNING, "Unregistered unknown client \"%s\": %s",
|
||||
c->id[0] ? c->id : "(No Nick)", txt );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: conf.c,v 1.77 2005/06/17 19:16:53 fw Exp $";
|
||||
static char UNUSED id[] = "$Id: conf.c,v 1.77.2.1 2005/10/11 19:28:47 alex Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -204,6 +204,7 @@ Conf_UnsetServer( CONN_ID Idx )
|
||||
* Non-Server-Connections will be silently ignored. */
|
||||
|
||||
int i;
|
||||
time_t t;
|
||||
|
||||
/* Check all our configured servers */
|
||||
for( i = 0; i < MAX_SERVERS; i++ )
|
||||
@@ -221,11 +222,14 @@ Conf_UnsetServer( CONN_ID Idx )
|
||||
else
|
||||
{
|
||||
/* Set time for next connect attempt */
|
||||
if( Conf_Server[i].lasttry < time( NULL ) - Conf_ConnectRetry )
|
||||
{
|
||||
/* Okay, the connection was established "long enough": */
|
||||
Conf_Server[i].lasttry = time( NULL ) - Conf_ConnectRetry + RECONNECT_DELAY;
|
||||
}
|
||||
t = time(NULL);
|
||||
if (Conf_Server[i].lasttry < t - Conf_ConnectRetry) {
|
||||
/* The connection has been "long", so we don't
|
||||
* require the next attempt to be delayed. */
|
||||
Conf_Server[i].lasttry =
|
||||
t - Conf_ConnectRetry + RECONNECT_DELAY;
|
||||
} else
|
||||
Conf_Server[i].lasttry = t;
|
||||
}
|
||||
}
|
||||
} /* Conf_UnsetServer */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: conn.c,v 1.155.2.1 2005/07/02 14:45:07 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: conn.c,v 1.155.2.4 2006/03/18 22:30:45 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -93,7 +93,7 @@ LOCAL void Init_Conn_Struct PARAMS(( CONN_ID Idx ));
|
||||
LOCAL bool Init_Socket PARAMS(( int Sock ));
|
||||
LOCAL void New_Server PARAMS(( int Server, CONN_ID Idx ));
|
||||
LOCAL void Read_Resolver_Result PARAMS(( int r_fd ));
|
||||
LOCAL void Simple_Message PARAMS(( int Sock, char *Msg ));
|
||||
LOCAL void Simple_Message PARAMS(( int Sock, const char *Msg ));
|
||||
LOCAL int Count_Connections PARAMS(( struct sockaddr_in addr ));
|
||||
|
||||
LOCAL fd_set My_Listeners;
|
||||
@@ -538,6 +538,7 @@ va_dcl
|
||||
#endif
|
||||
{
|
||||
char buffer[COMMAND_LEN];
|
||||
size_t len;
|
||||
bool ok;
|
||||
va_list ap;
|
||||
|
||||
@@ -583,8 +584,9 @@ va_dcl
|
||||
Log(LOG_DEBUG, " -> connection %d: '%s'.", Idx, buffer);
|
||||
#endif
|
||||
|
||||
strlcat( buffer, "\r\n", sizeof( buffer ));
|
||||
ok = Conn_Write( Idx, buffer, strlen( buffer ));
|
||||
len = strlcat( buffer, "\r\n", sizeof( buffer ));
|
||||
assert(len < COMMAND_LEN);
|
||||
ok = Conn_Write(Idx, buffer, len);
|
||||
My_Connections[Idx].msg_out++;
|
||||
|
||||
va_end( ap );
|
||||
@@ -694,24 +696,34 @@ Conn_Close( CONN_ID Idx, char *LogMsg, char *FwdMsg, bool InformClient )
|
||||
c = Client_GetFromConn( Idx );
|
||||
|
||||
/* Should the client be informed? */
|
||||
if( InformClient )
|
||||
{
|
||||
if (InformClient) {
|
||||
#ifndef STRICT_RFC
|
||||
/* Send statistics to client if registered as user: */
|
||||
if(( c != NULL ) && ( Client_Type( c ) == CLIENT_USER ))
|
||||
{
|
||||
Conn_WriteStr( Idx, "NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.", Client_ThisServer( ), NOTICE_TXTPREFIX, (double)My_Connections[Idx].bytes_in / 1024, (double)My_Connections[Idx].bytes_out / 1024 );
|
||||
if ((c != NULL) && (Client_Type(c) == CLIENT_USER)) {
|
||||
Conn_WriteStr( Idx,
|
||||
"NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.",
|
||||
Client_ID(Client_ThisServer()), NOTICE_TXTPREFIX,
|
||||
(double)My_Connections[Idx].bytes_in / 1024,
|
||||
(double)My_Connections[Idx].bytes_out / 1024);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Send ERROR to client (see RFC!) */
|
||||
if( FwdMsg ) Conn_WriteStr( Idx, "ERROR :%s", FwdMsg );
|
||||
else Conn_WriteStr( Idx, "ERROR :Closing connection." );
|
||||
if (FwdMsg)
|
||||
Conn_WriteStr(Idx, "ERROR :%s", FwdMsg);
|
||||
else
|
||||
Conn_WriteStr(Idx, "ERROR :Closing connection.");
|
||||
}
|
||||
|
||||
/* Try to write out the write buffer */
|
||||
/* Try to write out the write buffer. Note: Handle_Write() eventually
|
||||
* removes the CLIENT structure associated with this connection if an
|
||||
* error occurs! So we have to re-check if there is still an valid
|
||||
* CLIENT structure after calling Handle_Write() ...*/
|
||||
(void)Handle_Write( Idx );
|
||||
|
||||
/* Search client, if any (re-check!) */
|
||||
c = Client_GetFromConn( Idx );
|
||||
|
||||
/* Shut down socket */
|
||||
if( close( My_Connections[Idx].sock ) != 0 )
|
||||
{
|
||||
@@ -855,23 +867,28 @@ Handle_Write( CONN_ID Idx )
|
||||
res = getsockopt( My_Connections[Idx].sock, SOL_SOCKET, SO_ERROR, &err, &sock_len );
|
||||
assert( sock_len == sizeof( err ));
|
||||
|
||||
/* Fehler aufgetreten? */
|
||||
if(( res != 0 ) || ( err != 0 ))
|
||||
{
|
||||
/* Fehler! */
|
||||
if( res != 0 ) Log( LOG_CRIT, "getsockopt (connection %d): %s!", Idx, strerror( errno ));
|
||||
else Log( LOG_CRIT, "Can't connect socket to \"%s:%d\" (connection %d): %s!", My_Connections[Idx].host, Conf_Server[Conf_GetServer( Idx )].port, Idx, strerror( err ));
|
||||
/* Error while connecting? */
|
||||
if ((res != 0) || (err != 0)) {
|
||||
if (res != 0)
|
||||
Log(LOG_CRIT, "getsockopt (connection %d): %s!",
|
||||
Idx, strerror(errno));
|
||||
else
|
||||
Log(LOG_CRIT,
|
||||
"Can't connect socket to \"%s:%d\" (connection %d): %s!",
|
||||
My_Connections[Idx].host,
|
||||
Conf_Server[Conf_GetServer(Idx)].port,
|
||||
Idx, strerror(err));
|
||||
|
||||
/* Clean up socket, connection and client structures */
|
||||
FD_CLR( My_Connections[Idx].sock, &My_Sockets );
|
||||
c = Client_GetFromConn( Idx );
|
||||
if( c ) Client_DestroyNow( c );
|
||||
close( My_Connections[Idx].sock );
|
||||
Init_Conn_Struct( Idx );
|
||||
/* Clean up the CLIENT structure (to avoid silly log
|
||||
* messages) and call Conn_Close() to do the rest. */
|
||||
c = Client_GetFromConn(Idx);
|
||||
if (c)
|
||||
Client_DestroyNow(c);
|
||||
|
||||
/* Bei Server-Verbindungen lasttry-Zeitpunkt auf "jetzt" setzen */
|
||||
Conf_Server[Conf_GetServer( Idx )].lasttry = time( NULL );
|
||||
Conf_UnsetServer( Idx );
|
||||
Conn_Close(Idx, "Can't connect!", NULL, false);
|
||||
|
||||
/* Set the timestamp of the last connect attempt */
|
||||
Conf_UnsetServer(Idx);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1171,15 +1188,17 @@ Handle_Buffer( CONN_ID Idx )
|
||||
char *ptr;
|
||||
int len, delta;
|
||||
bool action, result;
|
||||
time_t starttime;
|
||||
#ifdef ZLIB
|
||||
bool old_z;
|
||||
#endif
|
||||
|
||||
starttime = time(NULL);
|
||||
result = false;
|
||||
do
|
||||
{
|
||||
/* Check penalty */
|
||||
if( My_Connections[Idx].delaytime > time( NULL )) return result;
|
||||
if( My_Connections[Idx].delaytime > starttime) return result;
|
||||
|
||||
#ifdef ZLIB
|
||||
/* ggf. noch unkomprimiete Daten weiter entpacken */
|
||||
@@ -1676,9 +1695,10 @@ try_resolve:
|
||||
|
||||
|
||||
LOCAL void
|
||||
Simple_Message( int Sock, char *Msg )
|
||||
Simple_Message( int Sock, const char *Msg )
|
||||
{
|
||||
char buf[COMMAND_LEN];
|
||||
size_t len;
|
||||
/* Write "simple" message to socket, without using compression
|
||||
* or even the connection write buffers. Used e.g. for error
|
||||
* messages by New_Connection(). */
|
||||
@@ -1686,8 +1706,9 @@ Simple_Message( int Sock, char *Msg )
|
||||
assert( Msg != NULL );
|
||||
|
||||
strlcpy( buf, Msg, sizeof buf - 2);
|
||||
strlcat( buf, "\r\n", sizeof buf);
|
||||
(void)write( Sock, buf, strlen( buf ) );
|
||||
len = strlcat( buf, "\r\n", sizeof buf);
|
||||
assert(len < COMMAND_LEN);
|
||||
(void)write(Sock, buf, len);
|
||||
} /* Simple_Error */
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* (at your option) any later version.
|
||||
* Please read the file COPYING, README and AUTHORS for more information.
|
||||
*
|
||||
* $Id: conn.h,v 1.35 2005/06/12 16:28:55 alex Exp $
|
||||
* $Id: conn.h,v 1.35.2.1 2005/07/30 23:24:50 alex Exp $
|
||||
*
|
||||
* Connection management (header)
|
||||
*/
|
||||
@@ -21,11 +21,11 @@
|
||||
#include <time.h> /* for time_t, see below */
|
||||
|
||||
|
||||
#define CONN_ISCLOSING 1U /* Conn_Close() already called */
|
||||
#define CONN_ISCONNECTING 2U /* connect() in progress */
|
||||
#define CONN_ISCLOSING 1 /* Conn_Close() already called */
|
||||
#define CONN_ISCONNECTING 2 /* connect() in progress */
|
||||
|
||||
#ifdef ZLIB
|
||||
#define CONN_ZIP 4U /* zlib compressed link */
|
||||
#define CONN_ZIP 4 /* zlib compressed link */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: irc-channel.c,v 1.30 2005/06/12 18:23:59 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: irc-channel.c,v 1.30.2.2 2006/03/16 20:14:46 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -90,14 +90,9 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
||||
if( Client_Type( Client ) == CLIENT_USER )
|
||||
{
|
||||
/* Test if the user has reached his maximum channel count */
|
||||
if( Client_Type( Client ) == CLIENT_USER )
|
||||
{
|
||||
if(( Conf_MaxJoins > 0 ) && ( Channel_CountForUser( Client ) >= Conf_MaxJoins ))
|
||||
{
|
||||
IRC_WriteStrClient( Client, ERR_TOOMANYCHANNELS_MSG, Client_ID( Client ), channame );
|
||||
return CONNECTED;
|
||||
}
|
||||
}
|
||||
if(( Conf_MaxJoins > 0 ) && ( Channel_CountForUser( Client ) >= Conf_MaxJoins ))
|
||||
return IRC_WriteStrClient( Client, ERR_TOOMANYCHANNELS_MSG,
|
||||
Client_ID( Client ), channame );
|
||||
|
||||
/* Existiert der Channel bereits, oder wird er im Moment neu erzeugt? */
|
||||
if( is_new_chan )
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: irc-login.c,v 1.44 2005/06/04 12:32:09 fw Exp $";
|
||||
static char UNUSED id[] = "$Id: irc-login.c,v 1.44.2.1 2005/12/15 11:01:59 alex Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -456,7 +456,15 @@ IRC_PING( CLIENT *Client, REQUEST *Req )
|
||||
}
|
||||
|
||||
Log( LOG_DEBUG, "Connection %d: got PING, sending PONG ...", Client_Conn( Client ));
|
||||
return IRC_WriteStrClient( Client, "PONG %s :%s", Client_ID( Client_ThisServer( )), Client_ID( Client ));
|
||||
#ifdef STRICT_RFC
|
||||
return IRC_WriteStrClient(Client, "PONG %s :%s",
|
||||
Client_ID(Client_ThisServer()), Client_ID(Client));
|
||||
#else
|
||||
/* Some clients depend on the argument being returned in the PONG
|
||||
* reply (not mentioned in any RFC, though) */
|
||||
return IRC_WriteStrClient(Client, "PONG %s :%s",
|
||||
Client_ID(Client_ThisServer( )), Req->argv[0]);
|
||||
#endif
|
||||
} /* IRC_PING */
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: irc.c,v 1.126 2005/04/18 15:44:39 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: irc.c,v 1.126.2.1 2005/08/02 23:08:27 alex Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -151,7 +151,7 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
|
||||
}
|
||||
|
||||
/* Kill client NOW! */
|
||||
conn = Client_Conn( Client_NextHop( c ));
|
||||
conn = Client_Conn( c );
|
||||
Client_Destroy( c, NULL, reason, false );
|
||||
if( conn > NONE )
|
||||
Conn_Close( conn, NULL, reason, true );
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ngIRCd -- The Next Generation IRC Daemon
|
||||
* Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
|
||||
* Copyright (c)2001-2005 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
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: log.c,v 1.57 2005/06/24 19:55:10 alex Exp $";
|
||||
static char UNUSED id[] = "$Id: log.c,v 1.57.2.2 2006/02/08 21:23:21 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -44,15 +44,15 @@ static char UNUSED id[] = "$Id: log.c,v 1.57 2005/06/24 19:55:10 alex Exp $";
|
||||
#include "log.h"
|
||||
|
||||
|
||||
LOCAL char Init_Txt[127];
|
||||
LOCAL bool Is_Daemon;
|
||||
static char Init_Txt[127];
|
||||
static bool Is_Daemon;
|
||||
|
||||
#ifdef DEBUG
|
||||
LOCAL char Error_File[FNAME_LEN];
|
||||
static char Error_File[FNAME_LEN];
|
||||
#endif
|
||||
|
||||
|
||||
LOCAL void Wall_ServerNotice PARAMS(( char *Msg ));
|
||||
static void Wall_ServerNotice PARAMS(( char *Msg ));
|
||||
|
||||
|
||||
GLOBAL void
|
||||
@@ -162,6 +162,35 @@ Log_Exit( void )
|
||||
} /* Log_Exit */
|
||||
|
||||
|
||||
# ifdef PROTOTYPES
|
||||
GLOBAL void
|
||||
LogDebug( const char *Format, ... )
|
||||
# else
|
||||
GLOBAL void
|
||||
LogDebug( Format, va_alist )
|
||||
const char *Format;
|
||||
va_dcl
|
||||
# endif
|
||||
#ifdef DEBUG
|
||||
{
|
||||
char msg[MAX_LOG_MSG_LEN];
|
||||
va_list ap;
|
||||
|
||||
if (!NGIRCd_Debug) return;
|
||||
#ifdef PROTOTYPES
|
||||
va_start( ap, Format );
|
||||
#else
|
||||
va_start( ap );
|
||||
#endif
|
||||
vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
|
||||
va_end( ap );
|
||||
Log(LOG_DEBUG, "%s", msg);
|
||||
}
|
||||
#else
|
||||
{ /* do nothing */ }
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
#ifdef PROTOTYPES
|
||||
GLOBAL void
|
||||
Log( int Level, const char *Format, ... )
|
||||
@@ -174,7 +203,6 @@ va_dcl
|
||||
#endif
|
||||
{
|
||||
/* Eintrag in Logfile(s) schreiben */
|
||||
|
||||
char msg[MAX_LOG_MSG_LEN];
|
||||
bool snotice;
|
||||
va_list ap;
|
||||
@@ -302,19 +330,23 @@ va_dcl
|
||||
} /* Log_Resolver */
|
||||
|
||||
|
||||
LOCAL void
|
||||
/**
|
||||
* Send log messages to users flagged with the "s" mode.
|
||||
* @param Msg The message to send.
|
||||
*/
|
||||
static void
|
||||
Wall_ServerNotice( char *Msg )
|
||||
{
|
||||
/* Server-Notice an entsprechende User verschicken */
|
||||
|
||||
CLIENT *c;
|
||||
|
||||
assert( Msg != NULL );
|
||||
|
||||
c = Client_First( );
|
||||
while( c )
|
||||
{
|
||||
if(( Client_Conn( c ) > NONE ) && ( Client_HasMode( c, 's' ))) IRC_WriteStrClient( c, "NOTICE %s :%s%s", Client_ThisServer( ), NOTICE_TXTPREFIX, Msg );
|
||||
while(c) {
|
||||
if (Client_Conn(c) > NONE && Client_HasMode(c, 's'))
|
||||
IRC_WriteStrClient(c, "NOTICE %s :%s%s", Client_ID(c),
|
||||
NOTICE_TXTPREFIX, Msg);
|
||||
|
||||
c = Client_Next( c );
|
||||
}
|
||||
} /* Wall_ServerNotice */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* (at your option) any later version.
|
||||
* Please read the file COPYING, README and AUTHORS for more information.
|
||||
*
|
||||
* $Id: log.h,v 1.18 2005/06/24 19:55:10 alex Exp $
|
||||
* $Id: log.h,v 1.18.2.1 2006/02/08 21:23:21 fw Exp $
|
||||
*
|
||||
* Logging functions (header)
|
||||
*/
|
||||
@@ -39,6 +39,7 @@ GLOBAL void Log_Init PARAMS(( bool Daemon_Mode ));
|
||||
GLOBAL void Log_Exit PARAMS(( void ));
|
||||
|
||||
GLOBAL void Log PARAMS(( int Level, const char *Format, ... ));
|
||||
GLOBAL void LogDebug PARAMS(( const char *Format, ... ));
|
||||
|
||||
GLOBAL void Log_Init_Resolver PARAMS(( void ));
|
||||
GLOBAL void Log_Exit_Resolver PARAMS(( void ));
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
|
||||
static char UNUSED id[] = "$Id: resolve.c,v 1.12 2005/05/28 10:46:50 fw Exp $";
|
||||
static char UNUSED id[] = "$Id: resolve.c,v 1.12.2.1 2005/09/02 22:07:38 fw Exp $";
|
||||
|
||||
#include "imp.h"
|
||||
#include <assert.h>
|
||||
@@ -108,6 +108,8 @@ Resolve_Addr( struct sockaddr_in *Addr )
|
||||
else
|
||||
{
|
||||
/* Error! */
|
||||
close(s->pipe[0]);
|
||||
close(s->pipe[1]);
|
||||
free( s );
|
||||
Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
|
||||
return NULL;
|
||||
@@ -149,6 +151,8 @@ Resolve_Name( char *Host )
|
||||
else
|
||||
{
|
||||
/* Error! */
|
||||
close(s->pipe[0]);
|
||||
close(s->pipe[1]);
|
||||
free( s );
|
||||
Log( LOG_CRIT, "Resolver: Can't fork: %s!", strerror( errno ));
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user