From c83932ecfda0359e1b9a6bb5a48c8dafc80737ab Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 4 May 2007 22:01:02 +0000 Subject: Fix for bug #274, same port appearing multiple times in stats p if bound multiple times on different ip addresses git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6882 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_stats.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index 7197b15df..5e9252381 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -68,8 +68,12 @@ void DoStats(InspIRCd* ServerInstance, char statschar, userrec* user, string_lis } for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++) { - results.push_back(sn+" 249 "+user->nick+" :p:"+ConvToStr(ServerInstance->Config->ports[i])+" (" + ConvToStr(pc[ServerInstance->Config->ports[i]])+" client" + - (pc[ServerInstance->Config->ports[i]] != 1 ? "s" : "") + "), "+ServerInstance->Config->openSockfd[i]->GetDescription()); + if (pc[ServerInstance->Config->ports[i]] >= 0) + { + results.push_back(sn+" 249 "+user->nick+" :p:"+ConvToStr(ServerInstance->Config->ports[i])+" (" + ConvToStr(pc[ServerInstance->Config->ports[i]])+" client" + + (pc[ServerInstance->Config->ports[i]] != 1 ? "s" : "") + "), "+ServerInstance->Config->openSockfd[i]->GetDescription()); + pc[ServerInstance->Config->ports[i]] = -1; + } } } break; -- cgit v1.2.3