]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Fixed TRACE: don't output "Serv" lines for ourself; display more info.
authorAlexander Barton <alex@barton.de>
Sat, 28 Feb 2004 02:18:16 +0000 (02:18 +0000)
committerAlexander Barton <alex@barton.de>
Sat, 28 Feb 2004 02:18:16 +0000 (02:18 +0000)
ChangeLog
src/ngircd/irc.c
src/ngircd/messages.h

index 940dce2410ca3e950f365fa0150cb2aab23d3654..ab898ecd1b7bb9da8acfd16dd1791f9e42009420 100644 (file)
--- a/ChangeLog
+++ b/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 $
index a4355dd41ea9a75d7d0ff31fc3303fd5cdfe5d01..8d7f6d37cb6c78f076c7afb9bfb33b215a9177ac 100644 (file)
@@ -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 */
index 3ac479e8b6e7f454ba467b0b79c7e3c580a82550..c6847cf4ccd0395056ba38841d6c0f862049f082 100644 (file)
@@ -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"