mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
don't test failed tunnels
This commit is contained in:
parent
20369cf6d5
commit
17fcd0c38f
@ -141,6 +141,8 @@ namespace util
|
|||||||
it->GetTunnelConfig ()->Print (s);
|
it->GetTunnelConfig ()->Print (s);
|
||||||
if (it->GetTunnelPool ())
|
if (it->GetTunnelPool ())
|
||||||
s << " " << "Pool";
|
s << " " << "Pool";
|
||||||
|
if (it->IsFailed ())
|
||||||
|
s << " " << "Failed";
|
||||||
s << " " << (int)it->GetNumSentBytes () << "<BR>";
|
s << " " << (int)it->GetNumSentBytes () << "<BR>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,6 +151,8 @@ namespace util
|
|||||||
it.second->GetTunnelConfig ()->Print (s);
|
it.second->GetTunnelConfig ()->Print (s);
|
||||||
if (it.second->GetTunnelPool ())
|
if (it.second->GetTunnelPool ())
|
||||||
s << " " << "Pool";
|
s << " " << "Pool";
|
||||||
|
if (it.second->IsFailed ())
|
||||||
|
s << " " << "Failed";
|
||||||
s << " " << (int)it.second->GetNumReceivedBytes () << "<BR>";
|
s << " " << (int)it.second->GetNumReceivedBytes () << "<BR>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
Tunnel.h
2
Tunnel.h
@ -37,7 +37,7 @@ namespace tunnel
|
|||||||
|
|
||||||
TunnelConfig * GetTunnelConfig () const { return m_Config; }
|
TunnelConfig * GetTunnelConfig () const { return m_Config; }
|
||||||
bool IsEstablished () const { return m_IsEstablished; };
|
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; }
|
void SetFailed (bool failed) { m_IsFailed = failed; }
|
||||||
|
|
||||||
TunnelPool * GetTunnelPool () const { return m_Pool; };
|
TunnelPool * GetTunnelPool () const { return m_Pool; };
|
||||||
|
@ -118,11 +118,25 @@ namespace tunnel
|
|||||||
auto it2 = m_InboundTunnels.begin ();
|
auto it2 = m_InboundTunnels.begin ();
|
||||||
while (it1 != m_OutboundTunnels.end () && it2 != m_InboundTunnels.end ())
|
while (it1 != m_OutboundTunnels.end () && it2 != m_InboundTunnels.end ())
|
||||||
{
|
{
|
||||||
uint32_t msgID = rnd.GenerateWord32 ();
|
bool failed = false;
|
||||||
m_Tests[msgID] = std::make_pair (*it1, *it2);
|
if ((*it1)->IsFailed ())
|
||||||
(*it1)->SendTunnelDataMsg ((*it2)->GetNextIdentHash (), (*it2)->GetNextTunnelID (),
|
{
|
||||||
CreateDeliveryStatusMsg (msgID));
|
failed = true;
|
||||||
it1++; it2++;
|
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++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user