mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
Destinations: set thread name from tunnel name
Signed-off-by: r4sas <r4sas@i2pmail.org>
This commit is contained in:
parent
7285caa4f1
commit
574d12298b
3 changed files with 48 additions and 31 deletions
|
@ -1517,6 +1517,8 @@ namespace client
|
||||||
RunnableService ("Destination"),
|
RunnableService ("Destination"),
|
||||||
ClientDestination (GetIOService (), keys, isPublic, params)
|
ClientDestination (GetIOService (), keys, isPublic, params)
|
||||||
{
|
{
|
||||||
|
if (!GetNickname ().empty ())
|
||||||
|
RunnableService::SetName (GetNickname ());
|
||||||
}
|
}
|
||||||
|
|
||||||
RunnableClientDestination::~RunnableClientDestination ()
|
RunnableClientDestination::~RunnableClientDestination ()
|
||||||
|
|
|
@ -183,6 +183,8 @@ namespace util
|
||||||
void StartIOService ();
|
void StartIOService ();
|
||||||
void StopIOService ();
|
void StopIOService ();
|
||||||
|
|
||||||
|
void SetName (std::string_view name) { m_Name = name; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void Run ();
|
void Run ();
|
||||||
|
|
|
@ -421,7 +421,8 @@ namespace client
|
||||||
{ I2CP_PARAM_INBOUND_TUNNELS_QUANTITY, "3" },
|
{ I2CP_PARAM_INBOUND_TUNNELS_QUANTITY, "3" },
|
||||||
{ I2CP_PARAM_OUTBOUND_TUNNELS_QUANTITY, "3" },
|
{ I2CP_PARAM_OUTBOUND_TUNNELS_QUANTITY, "3" },
|
||||||
{ I2CP_PARAM_LEASESET_TYPE, "3" },
|
{ I2CP_PARAM_LEASESET_TYPE, "3" },
|
||||||
{ I2CP_PARAM_LEASESET_ENCRYPTION_TYPE, "0,4" }
|
{ I2CP_PARAM_LEASESET_ENCRYPTION_TYPE, "0,4" },
|
||||||
|
{ I2CP_PARAM_OUTBOUND_NICKNAME, "SharedDest" }
|
||||||
};
|
};
|
||||||
m_SharedLocalDestination = CreateNewLocalDestination (false, i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
m_SharedLocalDestination = CreateNewLocalDestination (false, i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
||||||
i2p::data::CRYPTO_KEY_TYPE_ELGAMAL, ¶ms); // non-public, EDDSA
|
i2p::data::CRYPTO_KEY_TYPE_ELGAMAL, ¶ms); // non-public, EDDSA
|
||||||
|
@ -596,6 +597,11 @@ namespace client
|
||||||
std::map<std::string, std::string> options;
|
std::map<std::string, std::string> options;
|
||||||
ReadI2CPOptions (section, false, options);
|
ReadI2CPOptions (section, false, options);
|
||||||
|
|
||||||
|
// Set I2CP name if not set
|
||||||
|
auto itopt = options.find (I2CP_PARAM_OUTBOUND_NICKNAME);
|
||||||
|
if (itopt == options.end ())
|
||||||
|
options[I2CP_PARAM_OUTBOUND_NICKNAME] = name;
|
||||||
|
|
||||||
std::shared_ptr<ClientDestination> localDestination = nullptr;
|
std::shared_ptr<ClientDestination> localDestination = nullptr;
|
||||||
if (keys.length () > 0)
|
if (keys.length () > 0)
|
||||||
{
|
{
|
||||||
|
@ -750,6 +756,11 @@ namespace client
|
||||||
std::map<std::string, std::string> options;
|
std::map<std::string, std::string> options;
|
||||||
ReadI2CPOptions (section, true, options);
|
ReadI2CPOptions (section, true, options);
|
||||||
|
|
||||||
|
// Set I2CP name if not set
|
||||||
|
auto itopt = options.find (I2CP_PARAM_INBOUND_NICKNAME);
|
||||||
|
if (itopt == options.end ())
|
||||||
|
options[I2CP_PARAM_INBOUND_NICKNAME] = name;
|
||||||
|
|
||||||
std::shared_ptr<ClientDestination> localDestination = nullptr;
|
std::shared_ptr<ClientDestination> localDestination = nullptr;
|
||||||
auto it = destinations.find (keys);
|
auto it = destinations.find (keys);
|
||||||
if (it != destinations.end ())
|
if (it != destinations.end ())
|
||||||
|
@ -897,6 +908,7 @@ namespace client
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> params;
|
std::map<std::string, std::string> params;
|
||||||
ReadI2CPOptionsFromConfig ("httpproxy.", params);
|
ReadI2CPOptionsFromConfig ("httpproxy.", params);
|
||||||
|
params[I2CP_PARAM_OUTBOUND_NICKNAME] = "HTTPProxy";
|
||||||
localDestination = CreateNewLocalDestination (keys, false, ¶ms);
|
localDestination = CreateNewLocalDestination (keys, false, ¶ms);
|
||||||
if (localDestination) localDestination->Acquire ();
|
if (localDestination) localDestination->Acquire ();
|
||||||
}
|
}
|
||||||
|
@ -945,6 +957,7 @@ namespace client
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> params;
|
std::map<std::string, std::string> params;
|
||||||
ReadI2CPOptionsFromConfig ("socksproxy.", params);
|
ReadI2CPOptionsFromConfig ("socksproxy.", params);
|
||||||
|
params[I2CP_PARAM_OUTBOUND_NICKNAME] = "SOCKSProxy";
|
||||||
localDestination = CreateNewLocalDestination (keys, false, ¶ms);
|
localDestination = CreateNewLocalDestination (keys, false, ¶ms);
|
||||||
if (localDestination) localDestination->Acquire ();
|
if (localDestination) localDestination->Acquire ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue