Browse Source

enable SSU

pull/46/head
orignal 11 years ago
parent
commit
adb6f284e8
  1. 2
      RouterContext.cpp
  2. 2
      RouterInfo.cpp
  3. 9
      Transports.cpp

2
RouterContext.cpp

@ -35,7 +35,7 @@ namespace i2p @@ -35,7 +35,7 @@ namespace i2p
i2p::data::RouterInfo routerInfo;
routerInfo.SetRouterIdentity (ident);
//routerInfo.AddSSUAddress ("127.0.0.1", 17007, routerInfo.GetIdentHash ());
routerInfo.AddSSUAddress ("127.0.0.1", 17007, routerInfo.GetIdentHash ());
routerInfo.AddNTCPAddress ("127.0.0.1", 17007); // TODO:
routerInfo.SetProperty ("caps", "LR");
routerInfo.SetProperty ("coreVersion", "0.9.8.1");

2
RouterInfo.cpp

@ -303,6 +303,7 @@ namespace data @@ -303,6 +303,7 @@ namespace data
addr.cost = 2;
addr.date = 0;
m_Addresses.push_back(addr);
m_SupportedTransports |= eNTCPV4;
}
void RouterInfo::AddSSUAddress (const char * host, int port, const uint8_t * key)
@ -315,6 +316,7 @@ namespace data @@ -315,6 +316,7 @@ namespace data
addr.date = 0;
memcpy (addr.key, key, 32);
m_Addresses.push_back(addr);
m_SupportedTransports |= eSSUV4;
}
void RouterInfo::SetProperty (const char * key, const char * value)

9
Transports.cpp

@ -39,23 +39,20 @@ namespace i2p @@ -39,23 +39,20 @@ namespace i2p
auto conn = new i2p::ntcp::NTCPServerConnection (m_Service);
m_NTCPAcceptor->async_accept(conn->GetSocket (), boost::bind (&Transports::HandleAccept, this,
conn, boost::asio::placeholders::error));
// temporary always run SSU server
// TODO: uncomment following lines later
/*}
}
else if (address.transportStyle == RouterInfo::eTransportSSU)
{*/
{
if (!m_SSUServer)
{
m_SSUServer = new i2p::ssu::SSUServer (m_Service, address.port);
LogPrint ("Start listening UDP port ", address.port);
m_SSUServer->Start ();
DetectExternalIP ();
}
else
LogPrint ("SSU server already exists");
}
}
//DetectExternalIP ();
}
void Transports::Stop ()

Loading…
Cancel
Save