Fixed TRACE: don't output "Serv" lines for ourself; display more info.

This commit is contained in:
Alexander Barton 2004-02-28 02:18:16 +00:00
parent 33f4e6763b
commit bdaf53e799
3 changed files with 11 additions and 10 deletions

View File

@ -12,6 +12,7 @@
ngIRCd CVSHEAD ngIRCd CVSHEAD
- Fixed TRACE: don't output "Serv" lines for ourself; display more info.
- Results of the resolver (hostnames and IDENT names) are discarded after - Results of the resolver (hostnames and IDENT names) are discarded after
the client is successfully registered with the server. the client is successfully registered with the server.
- Better logging while establishing and shutting down connections. - Better logging while establishing and shutting down connections.
@ -504,4 +505,4 @@ ngIRCd 0.0.1, 31.12.2001
-- --
$Id: ChangeLog,v 1.227 2004/02/28 02:01:01 alex Exp $ $Id: ChangeLog,v 1.228 2004/02/28 02:18:16 alex Exp $

View File

@ -1,6 +1,6 @@
/* /*
* ngIRCd -- The Next Generation IRC Daemon * ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de) * Copyright (c)2001-2004 Alexander Barton <alex@barton.de>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
#include "portab.h" #include "portab.h"
static char UNUSED id[] = "$Id: irc.c,v 1.123 2003/12/26 15:55:07 alex Exp $"; static char UNUSED id[] = "$Id: irc.c,v 1.124 2004/02/28 02:18:16 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@ -210,6 +210,7 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
{ {
CLIENT *from, *target, *c; CLIENT *from, *target, *c;
CONN_ID idx, idx2; CONN_ID idx, idx2;
CHAR user[CLIENT_USER_LEN];
assert( Client != NULL ); assert( Client != NULL );
assert( Req != NULL ); assert( Req != NULL );
@ -251,7 +252,9 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
if( Client_Type( c ) == CLIENT_SERVER ) if( Client_Type( c ) == CLIENT_SERVER )
{ {
/* Server link */ /* Server link */
if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Client_ID( c ), Client_Mask( c ), Option_String( Client_Conn( c )))) return DISCONNECTED; strlcpy( user, Client_User( c ), sizeof( user ));
if( user[0] == '~' ) strlcpy( user, "unknown", sizeof( user ));
if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Client_ID( c ), user, Client_Hostname( c ), Client_Mask( Client_ThisServer( )), Option_String( Client_Conn( c )))) return DISCONNECTED;
} }
if(( Client_Type( c ) == CLIENT_USER ) && ( strchr( Client_Modes( c ), 'o' ))) if(( Client_Type( c ) == CLIENT_USER ) && ( strchr( Client_Modes( c ), 'o' )))
{ {
@ -262,9 +265,6 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
c = Client_Next( c ); c = Client_Next( c );
} }
/* Some information about us */
if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Conf_ServerName, Client_Mask( Client_ThisServer( )), Option_String( Client_Conn( Client )))) return DISCONNECTED;
IRC_SetPenalty( Client, 3 ); IRC_SetPenalty( Client, 3 );
return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel ); return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel );
} /* IRC_TRACE */ } /* IRC_TRACE */

View File

@ -1,6 +1,6 @@
/* /*
* ngIRCd -- The Next Generation IRC Daemon * ngIRCd -- The Next Generation IRC Daemon
* Copyright (c)2001-2003 by Alexander Barton (alex@barton.de) * Copyright (c)2001-2004 Alexander Barton <alex@barton.de>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -8,7 +8,7 @@
* (at your option) any later version. * (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information. * Please read the file COPYING, README and AUTHORS for more information.
* *
* $Id: messages.h,v 1.65 2003/12/26 15:55:07 alex Exp $ * $Id: messages.h,v 1.66 2004/02/28 02:18:16 alex Exp $
* *
* IRC numerics (Header) * IRC numerics (Header)
*/ */
@ -26,7 +26,7 @@
#define RPL_TRACELINK_MSG "200 %s Link %s-%s %s %s V%s %ld %d %d" #define RPL_TRACELINK_MSG "200 %s Link %s-%s %s %s V%s %ld %d %d"
#define RPL_TRACEOPERATOR_MSG "204 %s Oper 2 :%s" #define RPL_TRACEOPERATOR_MSG "204 %s Oper 2 :%s"
#define RPL_TRACESERVER_MSG "206 %s Serv 1 0S 0C %s *!*@%s :V%s" #define RPL_TRACESERVER_MSG "206 %s Serv 1 0S 0C %s[%s@%s] *!*@%s :V%s"
#define RPL_STATSLINKINFO_MSG "211 %s %s %d %ld %ld %ld %ld :%ld" #define RPL_STATSLINKINFO_MSG "211 %s %s %d %ld %ld %ld %ld :%ld"
#define RPL_STATSCOMMANDS_MSG "212 %s %s %ld %ld %ld" #define RPL_STATSCOMMANDS_MSG "212 %s %s %ld %ld %ld"
#define RPL_ENDOFSTATS_MSG "219 %s %c :End of STATS report" #define RPL_ENDOFSTATS_MSG "219 %s %c :End of STATS report"