MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / FindOutgoingToken

Method FindOutgoingToken

libi2pd/SSU2.cpp:1250–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1248 }
1249
1250 uint64_t SSU2Server::FindOutgoingToken (const boost::asio::ip::udp::endpoint& ep)
1251 {
1252 auto it = m_OutgoingTokens.find (ep);
1253 if (it != m_OutgoingTokens.end ())
1254 {
1255 if (i2p::util::GetSecondsSinceEpoch () + SSU2_TOKEN_EXPIRATION_THRESHOLD > it->second.second)
1256 {
1257 // token expired
1258 m_OutgoingTokens.erase (it);
1259 return 0;
1260 }
1261 return it->second.first;
1262 }
1263 return 0;
1264 }
1265
1266 uint64_t SSU2Server::GetIncomingToken (const boost::asio::ip::udp::endpoint& ep)
1267 {

Callers 1

ConnectMethod · 0.80

Calls 1

GetSecondsSinceEpochFunction · 0.85

Tested by

no test coverage detected