unbreak (maybe?)

This commit is contained in:
Jeff Becker 2016-11-17 10:43:27 -05:00
parent e270f90f8d
commit 81276cb7f5
2 changed files with 5 additions and 5 deletions

View File

@ -550,7 +550,7 @@ namespace client
uint64_t now = i2p::util::GetMillisecondsSinceEpoch();
std::vector<uint16_t> removePorts;
for (const auto & s : m_Sessions) {
if (now - std::get<1>(s.second) >= delta)
if (now - s.second.second >= delta)
removePorts.push_back(s.first);
}
for(auto port : removePorts) {
@ -707,7 +707,7 @@ namespace client
// send off to remote i2p destination
m_LocalDest->GetDatagramDestination()->SendDatagramTo(m_RecvBuff, transferred, *m_RemoteIdent, remotePort, RemotePort);
// mark convo as active
std::get<1>(m_Sessions[remotePort]) = i2p::util::GetMillisecondsSinceEpoch();
m_Sessions[remotePort].second = i2p::util::GetMillisecondsSinceEpoch();
}
std::vector<std::shared_ptr<DatagramSessionInfo> > I2PUDPClientTunnel::GetSessions()
@ -748,9 +748,9 @@ namespace client
LogPrint(eLogDebug, "UDP Client: got ", len, "B from ", from.GetIdentHash().ToBase32());
uint8_t sendbuf[len];
memcpy(sendbuf, buf, len);
m_LocalSocket.send_to(boost::asio::buffer(buf, len), std::get<0>(itr->second));
m_LocalSocket.send_to(boost::asio::buffer(buf, len), itr->second.first);
// mark convo as active
std::get<1>(itr->second) = i2p::util::GetMillisecondsSinceEpoch();
itr->second.second = i2p::util::GetMillisecondsSinceEpoch();
}
}
else

View File

@ -230,7 +230,7 @@ namespace client
void ExpireStale(const uint64_t delta=I2P_UDP_SESSION_TIMEOUT);
private:
typedef std::tuple<boost::asio::ip::udp::endpoint, uint64_t> UDPConvo;
typedef std::pair<boost::asio::ip::udp::endpoint, uint64_t> UDPConvo;
void RecvFromLocal();
void HandleRecvFromLocal(const boost::system::error_code & e, std::size_t transferred);
void HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len);