mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
Destinations: set thread name from tunnel name
Signed-off-by: r4sas <r4sas@i2pmail.org>
This commit is contained in:
parent
7285caa4f1
commit
574d12298b
|
@ -1517,6 +1517,8 @@ namespace client
|
|||
RunnableService ("Destination"),
|
||||
ClientDestination (GetIOService (), keys, isPublic, params)
|
||||
{
|
||||
if (!GetNickname ().empty ())
|
||||
RunnableService::SetName (GetNickname ());
|
||||
}
|
||||
|
||||
RunnableClientDestination::~RunnableClientDestination ()
|
||||
|
|
|
@ -183,6 +183,8 @@ namespace util
|
|||
void StartIOService ();
|
||||
void StopIOService ();
|
||||
|
||||
void SetName (std::string_view name) { m_Name = name; };
|
||||
|
||||
private:
|
||||
|
||||
void Run ();
|
||||
|
|
|
@ -421,7 +421,8 @@ namespace client
|
|||
{ I2CP_PARAM_INBOUND_TUNNELS_QUANTITY, "3" },
|
||||
{ I2CP_PARAM_OUTBOUND_TUNNELS_QUANTITY, "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,
|
||||
i2p::data::CRYPTO_KEY_TYPE_ELGAMAL, ¶ms); // non-public, EDDSA
|
||||
|
@ -596,6 +597,11 @@ namespace client
|
|||
std::map<std::string, std::string> 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;
|
||||
if (keys.length () > 0)
|
||||
{
|
||||
|
@ -750,6 +756,11 @@ namespace client
|
|||
std::map<std::string, std::string> 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;
|
||||
auto it = destinations.find (keys);
|
||||
if (it != destinations.end ())
|
||||
|
@ -897,6 +908,7 @@ namespace client
|
|||
{
|
||||
std::map<std::string, std::string> params;
|
||||
ReadI2CPOptionsFromConfig ("httpproxy.", params);
|
||||
params[I2CP_PARAM_OUTBOUND_NICKNAME] = "HTTPProxy";
|
||||
localDestination = CreateNewLocalDestination (keys, false, ¶ms);
|
||||
if (localDestination) localDestination->Acquire ();
|
||||
}
|
||||
|
@ -945,6 +957,7 @@ namespace client
|
|||
{
|
||||
std::map<std::string, std::string> params;
|
||||
ReadI2CPOptionsFromConfig ("socksproxy.", params);
|
||||
params[I2CP_PARAM_OUTBOUND_NICKNAME] = "SOCKSProxy";
|
||||
localDestination = CreateNewLocalDestination (keys, false, ¶ms);
|
||||
if (localDestination) localDestination->Acquire ();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue