PPI: BUGFIX: Fix unthrottling when mixing multiple auto-forwarding routes with native...
g0dil [Wed, 1 Jul 2009 11:29:12 +0000 (11:29 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1253 270642c3-0616-0410-b53a-bc976706d245

PPI/Connectors.cc

index 4c5a3ea..6c1dade 100644 (file)
@@ -120,19 +120,12 @@ prefix_ void senf::ppi::connector::PassiveConnector::v_unthrottleEvent()
 
 prefix_ void senf::ppi::connector::PassiveConnector::notifyUnthrottle()
 {
-    if (throttled() && !nativeThrottled_) {
-        Routes::const_iterator i (routes_.begin());
-        Routes::const_iterator const i_end (routes_.end());
-        for (; i != i_end; ++i)
-            if ((*i)->throttled())
-                break;
-        if (i == i_end) {
-            remoteThrottled_ = false;
-            emitUnthrottle();
-        }
-    } 
-    else
+    if (std::find_if(routes_.begin(), routes_.end(), 
+                     boost::bind(&ForwardingRoute::throttled, _1)) == routes_.end()) {
         remoteThrottled_ = false;
+        if (!nativeThrottled_)
+            emitUnthrottle();
+    }
 }
 
 ///////////////////////////////////////////////////////////////////////////