From 03b3169e54fbe4d4cae99307810b1f52f85c8f5a Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 6 Dec 2010 18:02:26 +0200 Subject: [PATCH] =?utf8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC=D0=B0?= =?utf8?q?=20=D0=BA=D0=BE=D0=BF=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?utf8?q?=D1=8F=20=D0=B8=D1=82=D0=B5=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BE?= =?utf8?q?=D0=B2=20=D0=BF=D1=80=D0=B8=20=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB?= =?utf8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D0=B8=20swap=20=D0=BD=D0=B0=20=D0=B8?= =?utf8?q?=D0=BD=D0=B4=D0=B5=D0=BA=D1=81=D0=B5=20=D0=BF=D0=B0=D0=BA=D0=B5?= =?utf8?q?=D1=82=D0=BE=D0=B2=20=D0=BF=D0=BE=20IP-=D0=B0=D0=B4=D1=80=D0=B5?= =?utf8?q?=D1=81=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- projects/stargazer/traffcounter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/stargazer/traffcounter.cpp b/projects/stargazer/traffcounter.cpp index 54014167..e834b81f 100644 --- a/projects/stargazer/traffcounter.cpp +++ b/projects/stargazer/traffcounter.cpp @@ -287,7 +287,7 @@ int oldIp2packetsSize = ip2packets.size(); pp_iter pi; pi = packets.begin(); std::map newPackets; -std::multimap newIP2Packets; +ip2packets.erase(ip2packets.begin(), ip2packets.end()); while (pi != packets.end()) { //Flushing @@ -388,14 +388,13 @@ while (pi != packets.end()) pair res = newPackets.insert(*pi); if (res.second) { - newIP2Packets.insert(make_pair(pi->first.GetSrcIP(), res.first)); - newIP2Packets.insert(make_pair(pi->first.GetDstIP(), res.first)); + ip2packets.insert(make_pair(pi->first.GetSrcIP(), res.first)); + ip2packets.insert(make_pair(pi->first.GetDstIP(), res.first)); } } ++pi; } swap(packets, newPackets); -swap(ip2packets, newIP2Packets); printfd(__FILE__, "FlushAndRemove() packets: %d(rem %d) ip2packets: %d(rem %d)\n", packets.size(), oldPacketsSize - packets.size(), -- 2.44.2