diff --git a/Config.cpp b/Config.cpp index c8ce6d45..cd617f6f 100644 --- a/Config.cpp +++ b/Config.cpp @@ -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/," diff --git a/Destination.cpp b/Destination.cpp index 61960464..491a9f29 100644 --- a/Destination.cpp +++ b/Destination.cpp @@ -544,11 +544,14 @@ 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); + if (requestComplete) requestComplete (nullptr); + } + else if (requestComplete) + ret.first->second->requestComplete.push_back (requestComplete); } } else diff --git a/I2PTunnel.cpp b/I2PTunnel.cpp index e5c8dc0b..63ffaf3c 100644 --- a/I2PTunnel.cpp +++ b/I2PTunnel.cpp @@ -540,9 +540,13 @@ namespace client void I2PUDPServerTunnel::ExpireStale(const uint64_t delta) { std::lock_guard lock(m_SessionsMutex); uint64_t now = i2p::util::GetMillisecondsSinceEpoch(); - std::remove_if(m_Sessions.begin(), m_Sessions.end(), [now, delta](const std::shared_ptr & 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) { diff --git a/SSUSession.cpp b/SSUSession.cpp index 696d367f..0e277432 100644 --- a/SSUSession.cpp +++ b/SSUSession.cpp @@ -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"); diff --git a/Streaming.h b/Streaming.h index 65a8d8b4..bf19f92a 100644 --- a/Streaming.h +++ b/Streaming.h @@ -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 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);