mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
implement i2p.streaming.profile to specify high or low bandwidth tunnel pools
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user