diff --git a/HTTPServer.cpp b/HTTPServer.cpp
index f914fefd..1628ff7b 100644
--- a/HTTPServer.cpp
+++ b/HTTPServer.cpp
@@ -141,6 +141,8 @@ namespace util
it->GetTunnelConfig ()->Print (s);
if (it->GetTunnelPool ())
s << " " << "Pool";
+ if (it->IsFailed ())
+ s << " " << "Failed";
s << " " << (int)it->GetNumSentBytes () << "
";
}
@@ -149,6 +151,8 @@ namespace util
it.second->GetTunnelConfig ()->Print (s);
if (it.second->GetTunnelPool ())
s << " " << "Pool";
+ if (it.second->IsFailed ())
+ s << " " << "Failed";
s << " " << (int)it.second->GetNumReceivedBytes () << "
";
}
diff --git a/Tunnel.h b/Tunnel.h
index 0dddf447..6711bd3d 100644
--- a/Tunnel.h
+++ b/Tunnel.h
@@ -37,7 +37,7 @@ namespace tunnel
TunnelConfig * GetTunnelConfig () const { return m_Config; }
bool IsEstablished () const { return m_IsEstablished; };
- bool IsFailed () const { return m_IsEstablished; };
+ bool IsFailed () const { return m_IsFailed; };
void SetFailed (bool failed) { m_IsFailed = failed; }
TunnelPool * GetTunnelPool () const { return m_Pool; };
diff --git a/TunnelPool.cpp b/TunnelPool.cpp
index ab91963d..f71a63c3 100644
--- a/TunnelPool.cpp
+++ b/TunnelPool.cpp
@@ -118,11 +118,25 @@ namespace tunnel
auto it2 = m_InboundTunnels.begin ();
while (it1 != m_OutboundTunnels.end () && it2 != m_InboundTunnels.end ())
{
- uint32_t msgID = rnd.GenerateWord32 ();
- m_Tests[msgID] = std::make_pair (*it1, *it2);
- (*it1)->SendTunnelDataMsg ((*it2)->GetNextIdentHash (), (*it2)->GetNextTunnelID (),
- CreateDeliveryStatusMsg (msgID));
- it1++; it2++;
+ bool failed = false;
+ if ((*it1)->IsFailed ())
+ {
+ failed = true;
+ it1++;
+ }
+ if ((*it2)->IsFailed ())
+ {
+ failed = true;
+ it2++;
+ }
+ if (!failed)
+ {
+ uint32_t msgID = rnd.GenerateWord32 ();
+ m_Tests[msgID] = std::make_pair (*it1, *it2);
+ (*it1)->SendTunnelDataMsg ((*it2)->GetNextIdentHash (), (*it2)->GetNextTunnelID (),
+ CreateDeliveryStatusMsg (msgID));
+ it1++; it2++;
+ }
}
}