Commit Diff


commit - 33f4e6763b2e0d90f1ebdee92c53be0b0f647ba8
commit + bdaf53e799541bef5911f7793b901b2a5d56330a
blob - 940dce2410ca3e950f365fa0150cb2aab23d3654
blob + ab898ecd1b7bb9da8acfd16dd1791f9e42009420
--- ChangeLog
+++ ChangeLog
@@ -12,6 +12,7 @@
 
 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
     the client is successfully registered with the server.
   - 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 $
blob - a4355dd41ea9a75d7d0ff31fc3303fd5cdfe5d01
blob + 8d7f6d37cb6c78f076c7afb9bfb33b215a9177ac
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
@@ -1,6 +1,6 @@
 /*
  * 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
  * 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: 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 <assert.h>
@@ -210,6 +210,7 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
 {
 	CLIENT *from, *target, *c;
 	CONN_ID idx, idx2;
+	CHAR user[CLIENT_USER_LEN];
 
 	assert( Client != NULL );
 	assert( Req != NULL );
@@ -251,7 +252,9 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
 			if( Client_Type( c ) == CLIENT_SERVER )
 			{
 				/* 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' )))
 			{
@@ -262,9 +265,6 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
 		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 );
 	return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel );
 } /* IRC_TRACE */
blob - 3ac479e8b6e7f454ba467b0b79c7e3c580a82550
blob + c6847cf4ccd0395056ba38841d6c0f862049f082
--- src/ngircd/messages.h
+++ src/ngircd/messages.h
@@ -1,6 +1,6 @@
 /*
  * 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
  * it under the terms of the GNU General Public License as published by
@@ -8,7 +8,7 @@
  * (at your option) any later version.
  * 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)
  */
@@ -26,7 +26,7 @@
 
 #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_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_STATSCOMMANDS_MSG		"212 %s %s %ld %ld %ld"
 #define RPL_ENDOFSTATS_MSG		"219 %s %c :End of STATS report"