Browse Source

don't test failed tunnels

pull/48/head
orignal 11 years ago
parent
commit
17fcd0c38f
  1. 4
      HTTPServer.cpp
  2. 2
      Tunnel.h
  3. 14
      TunnelPool.cpp

4
HTTPServer.cpp

@ -141,6 +141,8 @@ namespace util @@ -141,6 +141,8 @@ namespace util
it->GetTunnelConfig ()->Print (s);
if (it->GetTunnelPool ())
s << " " << "Pool";
if (it->IsFailed ())
s << " " << "Failed";
s << " " << (int)it->GetNumSentBytes () << "<BR>";
}
@ -149,6 +151,8 @@ namespace util @@ -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 () << "<BR>";
}

2
Tunnel.h

@ -37,7 +37,7 @@ namespace tunnel @@ -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; };

14
TunnelPool.cpp

@ -117,6 +117,19 @@ namespace tunnel @@ -117,6 +117,19 @@ namespace tunnel
auto it1 = m_OutboundTunnels.begin ();
auto it2 = m_InboundTunnels.begin ();
while (it1 != m_OutboundTunnels.end () && it2 != m_InboundTunnels.end ())
{
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);
@ -125,6 +138,7 @@ namespace tunnel @@ -125,6 +138,7 @@ namespace tunnel
it1++; it2++;
}
}
}
void TunnelPool::ProcessDeliveryStatus (I2NPMessage * msg)
{

Loading…
Cancel
Save