From 3cd34b62eb3fc47cc8a519171c1fa2ab09b76d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Thu, 9 Apr 2015 09:30:56 +0000 Subject: [PATCH] TimerPool fixoutManipulator git-svn-id: svn://db.shs.com.ru/pip@86 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/io/pipeer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/io/pipeer.cpp b/src/io/pipeer.cpp index 05db0d72..eb0676ae 100755 --- a/src/io/pipeer.cpp +++ b/src/io/pipeer.cpp @@ -112,12 +112,13 @@ void PIPeer::PeerInfo::destroy() { PIString PIPeer::PeerInfo::fastestAddress() const { double mp = -1.; PIString ret; - piForeachC (Address & a, addresses) - if (a.ping > 0.) { - if (mp < 0) mp = a.ping; - else mp = piMind(mp, a.ping); + piForeachC (Address & a, addresses) { + if (a.ping <= 0.) continue; + if ((mp < 0) || (mp > a.ping)) { + mp = a.ping; ret = a.address; } + } return ret; } @@ -756,6 +757,7 @@ void PIPeer::checkNetwork() { void PIPeer::initNetwork() { + eth_send.init(); destroyEths(); destroyMBcasts(); piCoutObj << "initNetwork";