Browse Source

Merge remote-tracking branch 'origin/udptunnel-fix'

pull/771/head
Jeff Becker 8 years ago
parent
commit
0c6ee5e139
  1. 2
      Config.cpp
  2. 7
      Destination.cpp
  3. 10
      I2PTunnel.cpp
  4. 2
      SSUSession.cpp
  5. 4
      Streaming.h

2
Config.cpp

@ -172,7 +172,7 @@ namespace config { @@ -172,7 +172,7 @@ namespace config {
"https://i2p.mooo.com/netDb/,"
"https://netdb.i2p2.no/,"
"https://us.reseed.i2p2.no:444/,"
"https://uk.reseed.i2p2.no:444/,"
// "https://uk.reseed.i2p2.no:444/," // mamoth's shit
"https://i2p-0.manas.ca:8443/,"
"https://reseed.i2p.vzaws.com:8443/,"
"https://download.xxlspeed.com/,"

7
Destination.cpp

@ -544,12 +544,15 @@ namespace client @@ -544,12 +544,15 @@ namespace client
else // duplicate
{
LogPrint (eLogInfo, "Destination: Request of LeaseSet ", dest.ToBase64 (), " is pending already");
// TODO: implement it properly
//ret.first->second->requestComplete.push_back (requestComplete);
if (ts > ret.first->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT)
{
// something went wrong
m_LeaseSetRequests.erase (ret.first);
if (requestComplete) requestComplete (nullptr);
}
else if (requestComplete)
ret.first->second->requestComplete.push_back (requestComplete);
}
}
else
{

10
I2PTunnel.cpp

@ -540,9 +540,13 @@ namespace client @@ -540,9 +540,13 @@ namespace client
void I2PUDPServerTunnel::ExpireStale(const uint64_t delta) {
std::lock_guard<std::mutex> lock(m_SessionsMutex);
uint64_t now = i2p::util::GetMillisecondsSinceEpoch();
std::remove_if(m_Sessions.begin(), m_Sessions.end(), [now, delta](const std::shared_ptr<UDPSession> & u) -> bool {
return now - u->LastActivity >= delta;
});
auto itr = m_Sessions.begin();
while(itr != m_Sessions.end()) {
if(now - (*itr)->LastActivity >= delta )
itr = m_Sessions.erase(itr);
else
++itr;
}
}
void I2PUDPClientTunnel::ExpireStale(const uint64_t delta) {

2
SSUSession.cpp

@ -1101,7 +1101,7 @@ namespace transport @@ -1101,7 +1101,7 @@ namespace transport
{
// we are Alice
LogPrint (eLogDebug, "SSU: sending peer test");
auto address = i2p::context.GetRouterInfo ().GetSSUAddress (false);
auto address = i2p::context.GetRouterInfo ().GetSSUAddress (i2p::context.SupportsV4 ());
if (!address)
{
LogPrint (eLogInfo, "SSU is not supported. Can't send peer test");

4
Streaming.h

@ -285,7 +285,7 @@ namespace stream @@ -285,7 +285,7 @@ namespace stream
auto s = shared_from_this();
m_Service.post ([=](void)
{
if (!m_ReceiveQueue.empty () || m_Status == eStreamStatusReset)
if (!m_ReceiveQueue.empty () || m_Status == eStreamStatusReset || m_Status == eStreamStatusClosed)
s->HandleReceiveTimer (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), buffer, handler, 0);
else
{
@ -306,7 +306,7 @@ namespace stream @@ -306,7 +306,7 @@ namespace stream
else if (ecode == boost::asio::error::operation_aborted)
{
// timeout not expired
if (m_Status == eStreamStatusReset)
if (m_Status == eStreamStatusReset || m_Status == eStreamStatusClosed)
handler (boost::asio::error::make_error_code (boost::asio::error::connection_reset), 0);
else
handler (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), 0);

Loading…
Cancel
Save