From f244d7ab4518a1119c624be453fc95e1344ed49d Mon Sep 17 00:00:00 2001 From: dgw Date: Mon, 10 Feb 2014 20:53:45 +0400 Subject: [PATCH] Add socket traffic stats to listsockets response Not yet added to Web interface though. --- modules/listsockets.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/listsockets.cpp b/modules/listsockets.cpp index 67a59075..8892e7fa 100644 --- a/modules/listsockets.cpp +++ b/modules/listsockets.cpp @@ -118,6 +118,7 @@ public: Row["SSL"] = pSocket->GetSSL() ? "Yes" : "No"; Row["Local"] = GetLocalHost(pSocket, true); Row["Remote"] = GetRemoteHost(pSocket, true); + // TODO: Traffic stats } return true; @@ -222,6 +223,8 @@ public: #endif Table.AddColumn("Local"); Table.AddColumn("Remote"); + Table.AddColumn("In"); + Table.AddColumn("Out"); while (!socks.empty()) { Csock* pSocket = socks.top().GetSock(); @@ -238,6 +241,8 @@ public: Table.SetCell("Local", GetLocalHost(pSocket, bShowHosts)); Table.SetCell("Remote", GetRemoteHost(pSocket, bShowHosts)); + Table.SetCell("In", CString::ToByteStr(pSocket->GetBytesRead())); + Table.SetCell("Out", CString::ToByteStr(pSocket->GetBytesWritten())); } PutModule(Table);