mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
replaced boost::asio::io_service by boost::asio:io_context
Some checks are pending
Build Debian packages / ${{ matrix.dist }} (bookworm) (push) Waiting to run
Build Debian packages / ${{ matrix.dist }} (bullseye) (push) Waiting to run
Build Debian packages / ${{ matrix.dist }} (buster) (push) Waiting to run
Build on FreeBSD / with UPnP (push) Waiting to run
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (no) (push) Waiting to run
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Waiting to run
Build on Windows / XP (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (no) (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (OFF) (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (ON) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (i386, linux/386) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (armv7, linux/arm/v7) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (amd64, linux/amd64) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (arm64, linux/arm64) (push) Waiting to run
Build containers / Pushing merged manifest (push) Blocked by required conditions
Some checks are pending
Build Debian packages / ${{ matrix.dist }} (bookworm) (push) Waiting to run
Build Debian packages / ${{ matrix.dist }} (bullseye) (push) Waiting to run
Build Debian packages / ${{ matrix.dist }} (buster) (push) Waiting to run
Build on FreeBSD / with UPnP (push) Waiting to run
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (no) (push) Waiting to run
Build on OSX / With USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Waiting to run
Build on Windows / ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (clang-x86_64, x64-clang, clang, CLANG64) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (i686, x86, gcc, MINGW32) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (ucrt-x86_64, x64-ucrt, gcc, UCRT64) (push) Waiting to run
Build on Windows / CMake ${{ matrix.arch }} (x86_64, x64, gcc, MINGW64) (push) Waiting to run
Build on Windows / XP (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (no) (push) Waiting to run
Build on Ubuntu / Make with USE_UPNP=${{ matrix.with_upnp }} (yes) (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (OFF) (push) Waiting to run
Build on Ubuntu / CMake with -DWITH_UPNP=${{ matrix.with_upnp }} (ON) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (i386, linux/386) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (armv7, linux/arm/v7) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (amd64, linux/amd64) (push) Waiting to run
Build containers / Building container for ${{ matrix.platform }} (arm64, linux/arm64) (push) Waiting to run
Build containers / Pushing merged manifest (push) Blocked by required conditions
This commit is contained in:
parent
5f1b31213f
commit
3474538697
|
@ -67,7 +67,7 @@ namespace transport
|
||||||
std::unique_ptr<std::thread> m_Thread;
|
std::unique_ptr<std::thread> m_Thread;
|
||||||
std::condition_variable m_Started;
|
std::condition_variable m_Started;
|
||||||
std::mutex m_StartedMutex;
|
std::mutex m_StartedMutex;
|
||||||
boost::asio::io_service m_Service;
|
boost::asio::io_context m_Service;
|
||||||
boost::asio::deadline_timer m_Timer;
|
boost::asio::deadline_timer m_Timer;
|
||||||
bool m_upnpUrlsInitialized = false;
|
bool m_upnpUrlsInitialized = false;
|
||||||
struct UPNPUrls m_upnpUrls;
|
struct UPNPUrls m_upnpUrls;
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace i2p
|
||||||
{
|
{
|
||||||
namespace client
|
namespace client
|
||||||
{
|
{
|
||||||
LeaseSetDestination::LeaseSetDestination (boost::asio::io_service& service,
|
LeaseSetDestination::LeaseSetDestination (boost::asio::io_context& service,
|
||||||
bool isPublic, const std::map<std::string, std::string> * params):
|
bool isPublic, const std::map<std::string, std::string> * params):
|
||||||
m_Service (service), m_IsPublic (isPublic), m_PublishReplyToken (0),
|
m_Service (service), m_IsPublic (isPublic), m_PublishReplyToken (0),
|
||||||
m_LastSubmissionTime (0), m_PublishConfirmationTimer (m_Service),
|
m_LastSubmissionTime (0), m_PublishConfirmationTimer (m_Service),
|
||||||
|
@ -1000,7 +1000,7 @@ namespace client
|
||||||
return i2p::data::CRYPTO_KEY_TYPE_ELGAMAL;
|
return i2p::data::CRYPTO_KEY_TYPE_ELGAMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClientDestination::ClientDestination (boost::asio::io_service& service, const i2p::data::PrivateKeys& keys,
|
ClientDestination::ClientDestination (boost::asio::io_context& service, const i2p::data::PrivateKeys& keys,
|
||||||
bool isPublic, const std::map<std::string, std::string> * params):
|
bool isPublic, const std::map<std::string, std::string> * params):
|
||||||
LeaseSetDestination (service, isPublic, params),
|
LeaseSetDestination (service, isPublic, params),
|
||||||
m_Keys (keys), m_StreamingAckDelay (DEFAULT_INITIAL_ACK_DELAY),
|
m_Keys (keys), m_StreamingAckDelay (DEFAULT_INITIAL_ACK_DELAY),
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace client
|
||||||
// leaseSet = nullptr means not found
|
// leaseSet = nullptr means not found
|
||||||
struct LeaseSetRequest
|
struct LeaseSetRequest
|
||||||
{
|
{
|
||||||
LeaseSetRequest (boost::asio::io_service& service): requestTime (0), requestTimeoutTimer (service) {};
|
LeaseSetRequest (boost::asio::io_context& service): requestTime (0), requestTimeoutTimer (service) {};
|
||||||
std::unordered_set<i2p::data::IdentHash> excluded;
|
std::unordered_set<i2p::data::IdentHash> excluded;
|
||||||
uint64_t requestTime;
|
uint64_t requestTime;
|
||||||
boost::asio::deadline_timer requestTimeoutTimer;
|
boost::asio::deadline_timer requestTimeoutTimer;
|
||||||
|
@ -125,10 +125,10 @@ namespace client
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
LeaseSetDestination (boost::asio::io_service& service, bool isPublic, const std::map<std::string, std::string> * params = nullptr);
|
LeaseSetDestination (boost::asio::io_context& service, bool isPublic, const std::map<std::string, std::string> * params = nullptr);
|
||||||
~LeaseSetDestination ();
|
~LeaseSetDestination ();
|
||||||
const std::string& GetNickname () const { return m_Nickname; };
|
const std::string& GetNickname () const { return m_Nickname; };
|
||||||
boost::asio::io_service& GetService () { return m_Service; };
|
auto& GetService () { return m_Service; };
|
||||||
|
|
||||||
virtual void Start ();
|
virtual void Start ();
|
||||||
virtual void Stop ();
|
virtual void Stop ();
|
||||||
|
@ -195,7 +195,7 @@ namespace client
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
boost::asio::io_service& m_Service;
|
boost::asio::io_context& m_Service;
|
||||||
mutable std::mutex m_RemoteLeaseSetsMutex;
|
mutable std::mutex m_RemoteLeaseSetsMutex;
|
||||||
std::unordered_map<i2p::data::IdentHash, std::shared_ptr<i2p::data::LeaseSet> > m_RemoteLeaseSets;
|
std::unordered_map<i2p::data::IdentHash, std::shared_ptr<i2p::data::LeaseSet> > m_RemoteLeaseSets;
|
||||||
std::unordered_map<i2p::data::IdentHash, std::shared_ptr<LeaseSetRequest> > m_LeaseSetRequests;
|
std::unordered_map<i2p::data::IdentHash, std::shared_ptr<LeaseSetRequest> > m_LeaseSetRequests;
|
||||||
|
@ -241,7 +241,7 @@ namespace client
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ClientDestination (boost::asio::io_service& service, const i2p::data::PrivateKeys& keys,
|
ClientDestination (boost::asio::io_context& service, const i2p::data::PrivateKeys& keys,
|
||||||
bool isPublic, const std::map<std::string, std::string> * params = nullptr);
|
bool isPublic, const std::map<std::string, std::string> * params = nullptr);
|
||||||
~ClientDestination ();
|
~ClientDestination ();
|
||||||
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ namespace transport
|
||||||
|
|
||||||
void Start ();
|
void Start ();
|
||||||
void Stop ();
|
void Stop ();
|
||||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
auto& GetService () { return GetIOService (); };
|
||||||
std::mt19937& GetRng () { return m_Rng; };
|
std::mt19937& GetRng () { return m_Rng; };
|
||||||
|
|
||||||
bool AddNTCP2Session (std::shared_ptr<NTCP2Session> session, bool incoming = false);
|
bool AddNTCP2Session (std::shared_ptr<NTCP2Session> session, bool incoming = false);
|
||||||
|
|
|
@ -552,7 +552,7 @@ namespace data
|
||||||
if (!url.port)
|
if (!url.port)
|
||||||
url.port = 443;
|
url.port = 443;
|
||||||
|
|
||||||
boost::asio::io_service service;
|
boost::asio::io_context service;
|
||||||
boost::system::error_code ecode;
|
boost::system::error_code ecode;
|
||||||
|
|
||||||
boost::asio::ssl::context ctx(boost::asio::ssl::context::sslv23);
|
boost::asio::ssl::context ctx(boost::asio::ssl::context::sslv23);
|
||||||
|
@ -746,7 +746,7 @@ namespace data
|
||||||
if (!url.port) url.port = 80;
|
if (!url.port) url.port = 80;
|
||||||
|
|
||||||
boost::system::error_code ecode;
|
boost::system::error_code ecode;
|
||||||
boost::asio::io_service service;
|
boost::asio::io_context service;
|
||||||
boost::asio::ip::tcp::socket s(service, boost::asio::ip::tcp::v6());
|
boost::asio::ip::tcp::socket s(service, boost::asio::ip::tcp::v6());
|
||||||
|
|
||||||
auto it = boost::asio::ip::tcp::resolver(service).resolve (
|
auto it = boost::asio::ip::tcp::resolver(service).resolve (
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace transport
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ReceiveService (const std::string& name): RunnableService (name) {};
|
ReceiveService (const std::string& name): RunnableService (name) {};
|
||||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
auto& GetService () { return GetIOService (); };
|
||||||
void Start () { StartIOService (); };
|
void Start () { StartIOService (); };
|
||||||
void Stop () { StopIOService (); };
|
void Stop () { StopIOService (); };
|
||||||
};
|
};
|
||||||
|
@ -73,7 +73,7 @@ namespace transport
|
||||||
|
|
||||||
void Start ();
|
void Start ();
|
||||||
void Stop ();
|
void Stop ();
|
||||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
auto& GetService () { return GetIOService (); };
|
||||||
void SetLocalAddress (const boost::asio::ip::address& localAddress);
|
void SetLocalAddress (const boost::asio::ip::address& localAddress);
|
||||||
bool SetProxy (const std::string& address, uint16_t port);
|
bool SetProxy (const std::string& address, uint16_t port);
|
||||||
bool UsesProxy () const { return m_IsThroughProxy; };
|
bool UsesProxy () const { return m_IsThroughProxy; };
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace stream
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream::Stream (boost::asio::io_service& service, StreamingDestination& local,
|
Stream::Stream (boost::asio::io_context& service, StreamingDestination& local,
|
||||||
std::shared_ptr<const i2p::data::LeaseSet> remote, int port): m_Service (service),
|
std::shared_ptr<const i2p::data::LeaseSet> remote, int port): m_Service (service),
|
||||||
m_SendStreamID (0), m_SequenceNumber (0), m_DropWindowDelaySequenceNumber (0),
|
m_SendStreamID (0), m_SequenceNumber (0), m_DropWindowDelaySequenceNumber (0),
|
||||||
m_TunnelsChangeSequenceNumber (0), m_LastReceivedSequenceNumber (-1), m_PreviousReceivedSequenceNumber (-1),
|
m_TunnelsChangeSequenceNumber (0), m_LastReceivedSequenceNumber (-1), m_PreviousReceivedSequenceNumber (-1),
|
||||||
|
@ -95,7 +95,7 @@ namespace stream
|
||||||
m_PacketACKInterval = (1000000LL*STREAMING_MTU)/inboundSpeed;
|
m_PacketACKInterval = (1000000LL*STREAMING_MTU)/inboundSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream::Stream (boost::asio::io_service& service, StreamingDestination& local):
|
Stream::Stream (boost::asio::io_context& service, StreamingDestination& local):
|
||||||
m_Service (service), m_SendStreamID (0), m_SequenceNumber (0), m_DropWindowDelaySequenceNumber (0),
|
m_Service (service), m_SendStreamID (0), m_SequenceNumber (0), m_DropWindowDelaySequenceNumber (0),
|
||||||
m_TunnelsChangeSequenceNumber (0), m_LastReceivedSequenceNumber (-1), m_PreviousReceivedSequenceNumber (-1),
|
m_TunnelsChangeSequenceNumber (0), m_LastReceivedSequenceNumber (-1), m_PreviousReceivedSequenceNumber (-1),
|
||||||
m_LastConfirmedReceivedSequenceNumber (0), // for limit inbound speed
|
m_LastConfirmedReceivedSequenceNumber (0), // for limit inbound speed
|
||||||
|
|
|
@ -175,9 +175,9 @@ namespace stream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Stream (boost::asio::io_service& service, StreamingDestination& local,
|
Stream (boost::asio::io_context& service, StreamingDestination& local,
|
||||||
std::shared_ptr<const i2p::data::LeaseSet> remote, int port = 0); // outgoing
|
std::shared_ptr<const i2p::data::LeaseSet> remote, int port = 0); // outgoing
|
||||||
Stream (boost::asio::io_service& service, StreamingDestination& local); // incoming
|
Stream (boost::asio::io_context& service, StreamingDestination& local); // incoming
|
||||||
|
|
||||||
~Stream ();
|
~Stream ();
|
||||||
uint32_t GetSendStreamID () const { return m_SendStreamID; };
|
uint32_t GetSendStreamID () const { return m_SendStreamID; };
|
||||||
|
@ -255,7 +255,7 @@ namespace stream
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
boost::asio::io_service& m_Service;
|
boost::asio::io_context& m_Service;
|
||||||
uint32_t m_SendStreamID, m_RecvStreamID, m_SequenceNumber;
|
uint32_t m_SendStreamID, m_RecvStreamID, m_SequenceNumber;
|
||||||
uint32_t m_DropWindowDelaySequenceNumber;
|
uint32_t m_DropWindowDelaySequenceNumber;
|
||||||
uint32_t m_TunnelsChangeSequenceNumber;
|
uint32_t m_TunnelsChangeSequenceNumber;
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace util
|
||||||
static void SyncTimeWithNTP (const std::string& address)
|
static void SyncTimeWithNTP (const std::string& address)
|
||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "Timestamp: NTP request to ", address);
|
LogPrint (eLogInfo, "Timestamp: NTP request to ", address);
|
||||||
boost::asio::io_service service;
|
boost::asio::io_context service;
|
||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
auto it = boost::asio::ip::udp::resolver (service).resolve (
|
auto it = boost::asio::ip::udp::resolver (service).resolve (
|
||||||
boost::asio::ip::udp::resolver::query (address, "ntp"), ec);
|
boost::asio::ip::udp::resolver::query (address, "ntp"), ec);
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace util
|
||||||
|
|
||||||
bool m_IsRunning;
|
bool m_IsRunning;
|
||||||
std::unique_ptr<std::thread> m_Thread;
|
std::unique_ptr<std::thread> m_Thread;
|
||||||
boost::asio::io_service m_Service;
|
boost::asio::io_context m_Service;
|
||||||
boost::asio::deadline_timer m_Timer;
|
boost::asio::deadline_timer m_Timer;
|
||||||
int m_SyncInterval;
|
int m_SyncInterval;
|
||||||
std::vector<std::string> m_NTPServersList;
|
std::vector<std::string> m_NTPServersList;
|
||||||
|
|
|
@ -174,8 +174,8 @@ namespace transport
|
||||||
{
|
{
|
||||||
if (!m_Service)
|
if (!m_Service)
|
||||||
{
|
{
|
||||||
m_Service = new boost::asio::io_service ();
|
m_Service = new boost::asio::io_context ();
|
||||||
m_Work = new boost::asio::io_service::work (*m_Service);
|
m_Work = new boost::asio::io_context::work (*m_Service);
|
||||||
m_PeerCleanupTimer = new boost::asio::deadline_timer (*m_Service);
|
m_PeerCleanupTimer = new boost::asio::deadline_timer (*m_Service);
|
||||||
m_PeerTestTimer = new boost::asio::deadline_timer (*m_Service);
|
m_PeerTestTimer = new boost::asio::deadline_timer (*m_Service);
|
||||||
m_UpdateBandwidthTimer = new boost::asio::deadline_timer (*m_Service);
|
m_UpdateBandwidthTimer = new boost::asio::deadline_timer (*m_Service);
|
||||||
|
|
|
@ -139,7 +139,7 @@ namespace transport
|
||||||
bool IsOnline() const { return m_IsOnline; };
|
bool IsOnline() const { return m_IsOnline; };
|
||||||
void SetOnline (bool online);
|
void SetOnline (bool online);
|
||||||
|
|
||||||
boost::asio::io_service& GetService () { return *m_Service; };
|
auto& GetService () { return *m_Service; };
|
||||||
std::shared_ptr<i2p::crypto::X25519Keys> GetNextX25519KeysPair ();
|
std::shared_ptr<i2p::crypto::X25519Keys> GetNextX25519KeysPair ();
|
||||||
void ReuseX25519KeysPair (std::shared_ptr<i2p::crypto::X25519Keys> pair);
|
void ReuseX25519KeysPair (std::shared_ptr<i2p::crypto::X25519Keys> pair);
|
||||||
|
|
||||||
|
@ -207,8 +207,8 @@ namespace transport
|
||||||
volatile bool m_IsOnline;
|
volatile bool m_IsOnline;
|
||||||
bool m_IsRunning, m_IsNAT, m_CheckReserved;
|
bool m_IsRunning, m_IsNAT, m_CheckReserved;
|
||||||
std::thread * m_Thread;
|
std::thread * m_Thread;
|
||||||
boost::asio::io_service * m_Service;
|
boost::asio::io_context * m_Service;
|
||||||
boost::asio::io_service::work * m_Work;
|
boost::asio::io_context::work * m_Work;
|
||||||
boost::asio::deadline_timer * m_PeerCleanupTimer, * m_PeerTestTimer, * m_UpdateBandwidthTimer;
|
boost::asio::deadline_timer * m_PeerCleanupTimer, * m_PeerTestTimer, * m_UpdateBandwidthTimer;
|
||||||
|
|
||||||
SSU2Server * m_SSU2Server;
|
SSU2Server * m_SSU2Server;
|
||||||
|
|
|
@ -177,7 +177,7 @@ namespace util
|
||||||
RunnableService (const std::string& name): m_Name (name), m_IsRunning (false) {}
|
RunnableService (const std::string& name): m_Name (name), m_IsRunning (false) {}
|
||||||
virtual ~RunnableService () {}
|
virtual ~RunnableService () {}
|
||||||
|
|
||||||
boost::asio::io_service& GetIOService () { return m_Service; }
|
auto& GetIOService () { return m_Service; }
|
||||||
bool IsRunning () const { return m_IsRunning; };
|
bool IsRunning () const { return m_IsRunning; };
|
||||||
|
|
||||||
void StartIOService ();
|
void StartIOService ();
|
||||||
|
@ -194,7 +194,7 @@ namespace util
|
||||||
std::string m_Name;
|
std::string m_Name;
|
||||||
volatile bool m_IsRunning;
|
volatile bool m_IsRunning;
|
||||||
std::unique_ptr<std::thread> m_Thread;
|
std::unique_ptr<std::thread> m_Thread;
|
||||||
boost::asio::io_service m_Service;
|
boost::asio::io_context m_Service;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RunnableServiceWithWork: public RunnableService
|
class RunnableServiceWithWork: public RunnableService
|
||||||
|
@ -206,7 +206,7 @@ namespace util
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
boost::asio::io_service::work m_Work;
|
boost::asio::io_context::work m_Work;
|
||||||
};
|
};
|
||||||
|
|
||||||
void SetThreadName (const char *name);
|
void SetThreadName (const char *name);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2023, The PurpleI2P Project
|
* Copyright (c) 2013-2024, The PurpleI2P Project
|
||||||
*
|
*
|
||||||
* This file is part of Purple i2pd project and licensed under BSD3
|
* This file is part of Purple i2pd project and licensed under BSD3
|
||||||
*
|
*
|
||||||
|
@ -254,7 +254,7 @@ namespace client
|
||||||
void Start ();
|
void Start ();
|
||||||
void Stop ();
|
void Stop ();
|
||||||
|
|
||||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
auto& GetService () { return GetIOService (); };
|
||||||
void AddDestination (const std::string& name, std::shared_ptr<BOBDestination> dest);
|
void AddDestination (const std::string& name, std::shared_ptr<BOBDestination> dest);
|
||||||
void DeleteDestination (const std::string& name);
|
void DeleteDestination (const std::string& name);
|
||||||
std::shared_ptr<BOBDestination> FindDestination (const std::string& name);
|
std::shared_ptr<BOBDestination> FindDestination (const std::string& name);
|
||||||
|
|
|
@ -345,7 +345,7 @@ namespace client
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (
|
std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (
|
||||||
boost::asio::io_service& service, bool isPublic,
|
boost::asio::io_context& service, bool isPublic,
|
||||||
i2p::data::SigningKeyType sigType, i2p::data::CryptoKeyType cryptoType,
|
i2p::data::SigningKeyType sigType, i2p::data::CryptoKeyType cryptoType,
|
||||||
const std::map<std::string, std::string> * params)
|
const std::map<std::string, std::string> * params)
|
||||||
{
|
{
|
||||||
|
@ -399,7 +399,7 @@ namespace client
|
||||||
return localDestination;
|
return localDestination;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (boost::asio::io_service& service,
|
std::shared_ptr<ClientDestination> ClientContext::CreateNewLocalDestination (boost::asio::io_context& service,
|
||||||
const i2p::data::PrivateKeys& keys, bool isPublic, const std::map<std::string, std::string> * params)
|
const i2p::data::PrivateKeys& keys, bool isPublic, const std::map<std::string, std::string> * params)
|
||||||
{
|
{
|
||||||
auto it = m_Destinations.find (keys.GetPublic ()->GetIdentHash ());
|
auto it = m_Destinations.find (keys.GetPublic ()->GetIdentHash ());
|
||||||
|
|
|
@ -79,13 +79,13 @@ namespace client
|
||||||
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
||||||
i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL,
|
i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL,
|
||||||
const std::map<std::string, std::string> * params = nullptr); // used by SAM only
|
const std::map<std::string, std::string> * params = nullptr); // used by SAM only
|
||||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_service& service,
|
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_context& service,
|
||||||
bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
bool isPublic = false, i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519,
|
||||||
i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL,
|
i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL,
|
||||||
const std::map<std::string, std::string> * params = nullptr); // same as previous but on external io_service
|
const std::map<std::string, std::string> * params = nullptr); // same as previous but on external io_service
|
||||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true,
|
std::shared_ptr<ClientDestination> CreateNewLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true,
|
||||||
const std::map<std::string, std::string> * params = nullptr);
|
const std::map<std::string, std::string> * params = nullptr);
|
||||||
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_service& service,
|
std::shared_ptr<ClientDestination> CreateNewLocalDestination (boost::asio::io_context& service,
|
||||||
const i2p::data::PrivateKeys& keys, bool isPublic = true,
|
const i2p::data::PrivateKeys& keys, bool isPublic = true,
|
||||||
const std::map<std::string, std::string> * params = nullptr); // same as previous but on external io_service
|
const std::map<std::string, std::string> * params = nullptr); // same as previous but on external io_service
|
||||||
std::shared_ptr<ClientDestination> CreateNewMatchedTunnelDestination(const i2p::data::PrivateKeys &keys,
|
std::shared_ptr<ClientDestination> CreateNewMatchedTunnelDestination(const i2p::data::PrivateKeys &keys,
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace i2p
|
||||||
namespace client
|
namespace client
|
||||||
{
|
{
|
||||||
|
|
||||||
I2CPDestination::I2CPDestination (boost::asio::io_service& service, std::shared_ptr<I2CPSession> owner,
|
I2CPDestination::I2CPDestination (boost::asio::io_context& service, std::shared_ptr<I2CPSession> owner,
|
||||||
std::shared_ptr<const i2p::data::IdentityEx> identity, bool isPublic, bool isSameThread,
|
std::shared_ptr<const i2p::data::IdentityEx> identity, bool isPublic, bool isSameThread,
|
||||||
const std::map<std::string, std::string>& params):
|
const std::map<std::string, std::string>& params):
|
||||||
LeaseSetDestination (service, isPublic, ¶ms),
|
LeaseSetDestination (service, isPublic, ¶ms),
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace client
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
I2CPDestination (boost::asio::io_service& service, std::shared_ptr<I2CPSession> owner,
|
I2CPDestination (boost::asio::io_context& service, std::shared_ptr<I2CPSession> owner,
|
||||||
std::shared_ptr<const i2p::data::IdentityEx> identity, bool isPublic, bool isSameThread,
|
std::shared_ptr<const i2p::data::IdentityEx> identity, bool isPublic, bool isSameThread,
|
||||||
const std::map<std::string, std::string>& params);
|
const std::map<std::string, std::string>& params);
|
||||||
~I2CPDestination () {};
|
~I2CPDestination () {};
|
||||||
|
@ -227,7 +227,7 @@ namespace client
|
||||||
|
|
||||||
void Start ();
|
void Start ();
|
||||||
void Stop ();
|
void Stop ();
|
||||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
auto& GetService () { return GetIOService (); };
|
||||||
bool IsSingleThread () const { return m_IsSingleThread; };
|
bool IsSingleThread () const { return m_IsSingleThread; };
|
||||||
|
|
||||||
bool InsertSession (std::shared_ptr<I2CPSession> session);
|
bool InsertSession (std::shared_ptr<I2CPSession> session);
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace client
|
||||||
}
|
}
|
||||||
void CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, uint16_t port = 0);
|
void CreateStream (StreamRequestComplete streamRequestComplete, const std::string& dest, uint16_t port = 0);
|
||||||
void CreateStream(StreamRequestComplete complete, std::shared_ptr<const Address> address, uint16_t port);
|
void CreateStream(StreamRequestComplete complete, std::shared_ptr<const Address> address, uint16_t port);
|
||||||
inline boost::asio::io_service& GetService () { return m_LocalDestination->GetService (); }
|
auto& GetService () { return m_LocalDestination->GetService (); }
|
||||||
|
|
||||||
virtual void Start () = 0;
|
virtual void Start () = 0;
|
||||||
virtual void Stop () = 0;
|
virtual void Stop () = 0;
|
||||||
|
|
|
@ -246,7 +246,7 @@ namespace client
|
||||||
void Start ();
|
void Start ();
|
||||||
void Stop ();
|
void Stop ();
|
||||||
|
|
||||||
boost::asio::io_service& GetService () { return GetIOService (); };
|
auto& GetService () { return GetIOService (); };
|
||||||
std::shared_ptr<SAMSession> CreateSession (const std::string& id, SAMSessionType type, const std::string& destination, // empty string means transient
|
std::shared_ptr<SAMSession> CreateSession (const std::string& id, SAMSessionType type, const std::string& destination, // empty string means transient
|
||||||
const std::map<std::string, std::string> * params);
|
const std::map<std::string, std::string> * params);
|
||||||
bool AddSession (std::shared_ptr<SAMSession> session);
|
bool AddSession (std::shared_ptr<SAMSession> session);
|
||||||
|
|
Loading…
Reference in a new issue