mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
implement i2p.streaming.profile to specify high or low bandwidth tunnel pools
This commit is contained in:
parent
5324197e43
commit
9f30499984
9 changed files with 44 additions and 25 deletions
|
@ -37,6 +37,7 @@ namespace client
|
|||
int inVar = DEFAULT_INBOUND_TUNNELS_LENGTH_VARIANCE;
|
||||
int outVar = DEFAULT_OUTBOUND_TUNNELS_LENGTH_VARIANCE;
|
||||
int numTags = DEFAULT_TAGS_TO_SEND;
|
||||
bool isHighBandwidth = true;
|
||||
std::shared_ptr<std::vector<i2p::data::IdentHash> > explicitPeers;
|
||||
try
|
||||
{
|
||||
|
@ -92,7 +93,7 @@ namespace client
|
|||
it = params->find (I2CP_PARAM_DONT_PUBLISH_LEASESET);
|
||||
if (it != params->end ())
|
||||
{
|
||||
// oveeride isPublic
|
||||
// override isPublic
|
||||
m_IsPublic = (it->second != "true");
|
||||
}
|
||||
it = params->find (I2CP_PARAM_LEASESET_TYPE);
|
||||
|
@ -121,6 +122,9 @@ namespace client
|
|||
m_LeaseSetPrivKey.reset (nullptr);
|
||||
}
|
||||
}
|
||||
it = params->find (I2CP_PARAM_STREAMING_PROFILE);
|
||||
if (it != params->end ())
|
||||
isHighBandwidth = std::stoi (it->second) != STREAMING_PROFILE_INTERACTIVE;
|
||||
}
|
||||
}
|
||||
catch (std::exception & ex)
|
||||
|
@ -128,7 +132,7 @@ namespace client
|
|||
LogPrint(eLogError, "Destination: Unable to parse parameters for destination: ", ex.what());
|
||||
}
|
||||
SetNumTags (numTags);
|
||||
m_Pool = i2p::tunnel::tunnels.CreateTunnelPool (inLen, outLen, inQty, outQty, inVar, outVar);
|
||||
m_Pool = i2p::tunnel::tunnels.CreateTunnelPool (inLen, outLen, inQty, outQty, inVar, outVar, isHighBandwidth);
|
||||
if (explicitPeers)
|
||||
m_Pool->SetExplicitPeers (explicitPeers);
|
||||
if(params)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue