Browse Source

exploratory pool added

pull/51/head
orignal 11 years ago
parent
commit
489266e7fc
  1. 2
      HTTPServer.cpp
  2. 2
      Tunnel.cpp
  3. 1
      Tunnel.h
  4. 1
      TunnelPool.cpp
  5. 2
      TunnelPool.h

2
HTTPServer.cpp

@ -255,7 +255,7 @@ namespace util
for (auto it: i2p::tunnel::tunnels.GetInboundTunnels ()) for (auto it: i2p::tunnel::tunnels.GetInboundTunnels ())
{ {
it.second->GetTunnelConfig ()->Print (s); it.second->GetTunnelConfig ()->Print (s);
if (it.second->GetTunnelPool ()) if (it.second->GetTunnelPool () && !it.second->GetTunnelPool ()->IsExploratory ())
s << " " << "Pool"; s << " " << "Pool";
if (it.second->IsFailed ()) if (it.second->IsFailed ())
s << " " << "Failed"; s << " " << "Failed";

2
Tunnel.cpp

@ -167,7 +167,7 @@ namespace tunnel
Tunnels tunnels; Tunnels tunnels;
Tunnels::Tunnels (): m_IsRunning (false), m_IsTunnelCreated (false), Tunnels::Tunnels (): m_IsRunning (false), m_IsTunnelCreated (false),
m_NextReplyMsgID (555),m_Thread (0) m_NextReplyMsgID (555), m_Thread (nullptr), m_ExploratoryPool (nullptr)
{ {
} }

1
Tunnel.h

@ -147,6 +147,7 @@ namespace tunnel
std::list<OutboundTunnel *> m_OutboundTunnels; std::list<OutboundTunnel *> m_OutboundTunnels;
std::map<uint32_t, TransitTunnel *> m_TransitTunnels; std::map<uint32_t, TransitTunnel *> m_TransitTunnels;
std::map<i2p::data::IdentHash, TunnelPool *> m_Pools; std::map<i2p::data::IdentHash, TunnelPool *> m_Pools;
TunnelPool * m_ExploratoryPool;
i2p::util::Queue<I2NPMessage> m_Queue; i2p::util::Queue<I2NPMessage> m_Queue;
public: public:

1
TunnelPool.cpp

@ -3,7 +3,6 @@
#include "Tunnel.h" #include "Tunnel.h"
#include "NetDb.h" #include "NetDb.h"
#include "Timestamp.h" #include "Timestamp.h"
#include "RouterContext.h"
#include "Garlic.h" #include "Garlic.h"
#include "TunnelPool.h" #include "TunnelPool.h"

2
TunnelPool.h

@ -9,6 +9,7 @@
#include "LeaseSet.h" #include "LeaseSet.h"
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "TunnelBase.h" #include "TunnelBase.h"
#include "RouterContext.h"
namespace i2p namespace i2p
{ {
@ -27,6 +28,7 @@ namespace tunnel
const uint8_t * GetEncryptionPrivateKey () const { return m_LocalDestination.GetEncryptionPrivateKey (); }; const uint8_t * GetEncryptionPrivateKey () const { return m_LocalDestination.GetEncryptionPrivateKey (); };
const uint8_t * GetEncryptionPublicKey () const { return m_LocalDestination.GetEncryptionPublicKey (); }; const uint8_t * GetEncryptionPublicKey () const { return m_LocalDestination.GetEncryptionPublicKey (); };
bool IsExploratory () const { return &m_LocalDestination == &i2p::context; };
void CreateTunnels (); void CreateTunnels ();
void TunnelCreated (InboundTunnel * createdTunnel); void TunnelCreated (InboundTunnel * createdTunnel);

Loading…
Cancel
Save