do actually rotate protocols in PingRotate
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 1 Apr 2015 08:32:05 +0000 (10:32 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 1 Apr 2015 08:55:18 +0000 (10:55 +0200)
src/host/pingrotate.cpp

index d01f447..64b0587 100644 (file)
@@ -159,16 +159,12 @@ void PingRotate::update_ping_protocol()
 void PingRotate::get_next_ping_protocol()
 {
     PingProtocol ping_protocol = ProtocolRotate.front();
-    if ( 1 <= ProtocolList.size() )
-    {
-        PingProtocol ping_protocol = ProtocolList.front();
-
-        ProtocolList.pop_front();
+    ProtocolRotate.pop_front();
+    ProtocolRotate.push_back(ping_protocol);
 
-        Ping = PingerFactory::createPinger( ping_protocol, IoService, NetworkInterfaceName, PingReplyTimeout );
+    Ping = PingerFactory::createPinger( ping_protocol, IoService, NetworkInterfaceName, PingReplyTimeout );
 
-        update_dns_resolver( ping_protocol );
-    }
+    update_dns_resolver( ping_protocol );
 }
 
 bool PingRotate::can_change_ping_protocol() const