mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
addressbook.enabled config param
This commit is contained in:
parent
14da941ff4
commit
1d6104ecf3
4 changed files with 19 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
|
@ -299,7 +299,8 @@ namespace client
|
|||
}
|
||||
|
||||
AddressBook::AddressBook (): m_Storage(nullptr), m_IsLoaded (false), m_IsDownloading (false),
|
||||
m_NumRetries (0), m_DefaultSubscription (nullptr), m_SubscriptionsUpdateTimer (nullptr)
|
||||
m_NumRetries (0), m_DefaultSubscription (nullptr), m_SubscriptionsUpdateTimer (nullptr),
|
||||
m_IsEnabled (true)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -310,12 +311,16 @@ namespace client
|
|||
|
||||
void AddressBook::Start ()
|
||||
{
|
||||
if (!m_Storage)
|
||||
m_Storage = new AddressBookFilesystemStorage;
|
||||
m_Storage->Init();
|
||||
LoadHosts (); /* try storage, then hosts.txt, then download */
|
||||
StartSubscriptions ();
|
||||
StartLookups ();
|
||||
i2p::config::GetOption("addressbook.enabled", m_IsEnabled);
|
||||
if (m_IsEnabled)
|
||||
{
|
||||
if (!m_Storage)
|
||||
m_Storage = new AddressBookFilesystemStorage;
|
||||
m_Storage->Init();
|
||||
LoadHosts (); /* try storage, then hosts.txt, then download */
|
||||
StartSubscriptions ();
|
||||
StartLookups ();
|
||||
}
|
||||
}
|
||||
|
||||
void AddressBook::StartResolvers ()
|
||||
|
@ -370,6 +375,7 @@ namespace client
|
|||
pos = address.find (".i2p");
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
if (!m_IsEnabled) return nullptr;
|
||||
auto addr = FindAddress (address);
|
||||
if (!addr)
|
||||
LookupAddress (address); // TODO:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2020, The PurpleI2P Project
|
||||
* Copyright (c) 2013-2022, The PurpleI2P Project
|
||||
*
|
||||
* This file is part of Purple i2pd project and licensed under BSD3
|
||||
*
|
||||
|
@ -126,6 +126,7 @@ namespace client
|
|||
std::vector<std::shared_ptr<AddressBookSubscription> > m_Subscriptions;
|
||||
std::shared_ptr<AddressBookSubscription> m_DefaultSubscription; // in case if we don't know any addresses yet
|
||||
boost::asio::deadline_timer * m_SubscriptionsUpdateTimer;
|
||||
bool m_IsEnabled;
|
||||
};
|
||||
|
||||
class AddressBookSubscription
|
||||
|
|
|
@ -864,6 +864,8 @@ namespace client
|
|||
uint16_t httpProxyPort; i2p::config::GetOption("httpproxy.port", httpProxyPort);
|
||||
std::string httpOutProxyURL; i2p::config::GetOption("httpproxy.outproxy", httpOutProxyURL);
|
||||
bool httpAddresshelper; i2p::config::GetOption("httpproxy.addresshelper", httpAddresshelper);
|
||||
if (httpAddresshelper)
|
||||
i2p::config::GetOption("addressbook.enabled", httpAddresshelper); // addresshelper is not supported without address book
|
||||
i2p::data::SigningKeyType sigType; i2p::config::GetOption("httpproxy.signaturetype", sigType);
|
||||
LogPrint(eLogInfo, "Clients: Starting HTTP Proxy at ", httpProxyAddr, ":", httpProxyPort);
|
||||
if (httpProxyKeys.length () > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue