mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
ms visual studio 2013 support
not full support
This commit is contained in:
13
Tunnel.cpp
13
Tunnel.cpp
@@ -1,4 +1,5 @@
|
||||
#include <endian.h>
|
||||
#include "I2PEndian.h"
|
||||
#include <boost/thread.hpp>
|
||||
#include <cryptopp/sha.h>
|
||||
#include "RouterContext.h"
|
||||
#include "Log.h"
|
||||
@@ -255,9 +256,9 @@ namespace tunnel
|
||||
|
||||
void Tunnels::Run ()
|
||||
{
|
||||
sleep (1); // wait for other parts are ready
|
||||
boost::this_thread::sleep(boost::posix_time::seconds(1)); // wait for other parts are ready
|
||||
|
||||
uint32_t lastTs = 0;
|
||||
uint64_t lastTs = 0;
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
@@ -283,7 +284,7 @@ namespace tunnel
|
||||
msg = m_Queue.Get ();
|
||||
}
|
||||
|
||||
uint32_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
uint64_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
if (ts - lastTs >= 15) // manage tunnels every 15 seconds
|
||||
{
|
||||
ManageTunnels ();
|
||||
@@ -326,7 +327,7 @@ namespace tunnel
|
||||
|
||||
void Tunnels::ManageOutboundTunnels ()
|
||||
{
|
||||
uint32_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
uint64_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
for (auto it = m_OutboundTunnels.begin (); it != m_OutboundTunnels.end ();)
|
||||
{
|
||||
if (ts > (*it)->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT)
|
||||
@@ -366,7 +367,7 @@ namespace tunnel
|
||||
|
||||
void Tunnels::ManageInboundTunnels ()
|
||||
{
|
||||
uint32_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
uint64_t ts = i2p::util::GetSecondsSinceEpoch ();
|
||||
for (auto it = m_InboundTunnels.begin (); it != m_InboundTunnels.end ();)
|
||||
{
|
||||
if (ts > it->second->GetCreationTime () + TUNNEL_EXPIRATION_TIMEOUT)
|
||||
|
||||
Reference in New Issue
Block a user