mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-19 09:29:58 +00:00
Merge remote-tracking branch 'origin/udptunnel-fix'
This commit is contained in:
commit
0c6ee5e139
@ -172,7 +172,7 @@ namespace config {
|
|||||||
"https://i2p.mooo.com/netDb/,"
|
"https://i2p.mooo.com/netDb/,"
|
||||||
"https://netdb.i2p2.no/,"
|
"https://netdb.i2p2.no/,"
|
||||||
"https://us.reseed.i2p2.no:444/,"
|
"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://i2p-0.manas.ca:8443/,"
|
||||||
"https://reseed.i2p.vzaws.com:8443/,"
|
"https://reseed.i2p.vzaws.com:8443/,"
|
||||||
"https://download.xxlspeed.com/,"
|
"https://download.xxlspeed.com/,"
|
||||||
|
@ -544,11 +544,14 @@ namespace client
|
|||||||
else // duplicate
|
else // duplicate
|
||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "Destination: Request of LeaseSet ", dest.ToBase64 (), " is pending already");
|
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)
|
if (ts > ret.first->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT)
|
||||||
|
{
|
||||||
|
// something went wrong
|
||||||
m_LeaseSetRequests.erase (ret.first);
|
m_LeaseSetRequests.erase (ret.first);
|
||||||
if (requestComplete) requestComplete (nullptr);
|
if (requestComplete) requestComplete (nullptr);
|
||||||
|
}
|
||||||
|
else if (requestComplete)
|
||||||
|
ret.first->second->requestComplete.push_back (requestComplete);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -540,9 +540,13 @@ namespace client
|
|||||||
void I2PUDPServerTunnel::ExpireStale(const uint64_t delta) {
|
void I2PUDPServerTunnel::ExpireStale(const uint64_t delta) {
|
||||||
std::lock_guard<std::mutex> lock(m_SessionsMutex);
|
std::lock_guard<std::mutex> lock(m_SessionsMutex);
|
||||||
uint64_t now = i2p::util::GetMillisecondsSinceEpoch();
|
uint64_t now = i2p::util::GetMillisecondsSinceEpoch();
|
||||||
std::remove_if(m_Sessions.begin(), m_Sessions.end(), [now, delta](const std::shared_ptr<UDPSession> & u) -> bool {
|
auto itr = m_Sessions.begin();
|
||||||
return now - u->LastActivity >= delta;
|
while(itr != m_Sessions.end()) {
|
||||||
});
|
if(now - (*itr)->LastActivity >= delta )
|
||||||
|
itr = m_Sessions.erase(itr);
|
||||||
|
else
|
||||||
|
++itr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void I2PUDPClientTunnel::ExpireStale(const uint64_t delta) {
|
void I2PUDPClientTunnel::ExpireStale(const uint64_t delta) {
|
||||||
|
@ -1101,7 +1101,7 @@ namespace transport
|
|||||||
{
|
{
|
||||||
// we are Alice
|
// we are Alice
|
||||||
LogPrint (eLogDebug, "SSU: sending peer test");
|
LogPrint (eLogDebug, "SSU: sending peer test");
|
||||||
auto address = i2p::context.GetRouterInfo ().GetSSUAddress (false);
|
auto address = i2p::context.GetRouterInfo ().GetSSUAddress (i2p::context.SupportsV4 ());
|
||||||
if (!address)
|
if (!address)
|
||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "SSU is not supported. Can't send peer test");
|
LogPrint (eLogInfo, "SSU is not supported. Can't send peer test");
|
||||||
|
@ -285,7 +285,7 @@ namespace stream
|
|||||||
auto s = shared_from_this();
|
auto s = shared_from_this();
|
||||||
m_Service.post ([=](void)
|
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);
|
s->HandleReceiveTimer (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), buffer, handler, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -306,7 +306,7 @@ namespace stream
|
|||||||
else if (ecode == boost::asio::error::operation_aborted)
|
else if (ecode == boost::asio::error::operation_aborted)
|
||||||
{
|
{
|
||||||
// timeout not expired
|
// 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);
|
handler (boost::asio::error::make_error_code (boost::asio::error::connection_reset), 0);
|
||||||
else
|
else
|
||||||
handler (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), 0);
|
handler (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user