-
-
Save lgv5/1831ac7c10d6a7de5d8e7e9d825ad69f to your computer and use it in GitHub Desktop.
i2pd 2.54.0 + boost 1.87.0-beta1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff refs/heads/master 06990b7a55b9bd202be1fac38c3ebabf50534218 | |
commit - 601805c76cc60fddc086621b9056815cca5b37aa | |
commit + 06990b7a55b9bd202be1fac38c3ebabf50534218 | |
blob - 0365408f420689fa597437aecc4f9d10a812c4f5 | |
blob + c543a433470c8ec8a43c68aca72d5b9937511a77 | |
--- net/i2pd/Makefile | |
+++ net/i2pd/Makefile | |
@@ -3,6 +3,7 @@ COMMENT = client for the I2P anonymous network | |
GH_ACCOUNT = PurpleI2P | |
GH_PROJECT = i2pd | |
GH_TAGNAME = 2.54.0 | |
+REVISION = 0 | |
CATEGORIES = net | |
HOMEPAGE = https://i2pd.website | |
blob - /dev/null | |
blob + c3af1e0a12f570a82725187584e114515f44bf80 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-daemon_HTTPServer_cpp | |
@@ -0,0 +1,17 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: daemon/HTTPServer.cpp | |
+--- daemon/HTTPServer.cpp.orig | |
++++ daemon/HTTPServer.cpp | |
+@@ -1485,8 +1485,8 @@ namespace http { | |
+ } | |
+ | |
+ HTTPServer::HTTPServer (const std::string& address, int port): | |
+- m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service), | |
+- m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::address::from_string(address), port)), | |
++ m_IsRunning (false), m_Thread (nullptr), m_Work (boost::asio::make_work_guard (m_Service)), | |
++ m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint (boost::asio::ip::make_address(address), port)), | |
+ m_Hostname(address) | |
+ { | |
+ } | |
blob - /dev/null | |
blob + a33eec11d3372411bd45a4ab481cf7a386ca026f (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-daemon_HTTPServer_h | |
@@ -0,0 +1,17 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: daemon/HTTPServer.h | |
+--- daemon/HTTPServer.h.orig | |
++++ daemon/HTTPServer.h | |
+@@ -83,8 +83,8 @@ namespace http | |
+ | |
+ bool m_IsRunning; | |
+ std::unique_ptr<std::thread> m_Thread; | |
+- boost::asio::io_service m_Service; | |
+- boost::asio::io_service::work m_Work; | |
++ boost::asio::io_context m_Service; | |
++ boost::asio::executor_work_guard<boost::asio::io_context::executor_type> m_Work; | |
+ boost::asio::ip::tcp::acceptor m_Acceptor; | |
+ std::string m_Hostname; | |
+ }; | |
blob - /dev/null | |
blob + 9465eb88741a3fe19d7bcacdb2a9ab58ebc88f7b (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-daemon_I2PControl_cpp | |
@@ -0,0 +1,12 @@ | |
+Index: daemon/I2PControl.cpp | |
+--- daemon/I2PControl.cpp.orig | |
++++ daemon/I2PControl.cpp | |
+@@ -31,7 +31,7 @@ namespace client | |
+ { | |
+ I2PControlService::I2PControlService (const std::string& address, int port): | |
+ m_IsRunning (false), m_Thread (nullptr), | |
+- m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(address), port)), | |
++ m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint(boost::asio::ip::make_address(address), port)), | |
+ m_SSLContext (boost::asio::ssl::context::sslv23), | |
+ m_ShutdownTimer (m_Service) | |
+ { | |
blob - /dev/null | |
blob + 902c9fcadc88d74ab6c2700c47c94c2bce620e46 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-daemon_I2PControl_h | |
@@ -0,0 +1,15 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: daemon/I2PControl.h | |
+--- daemon/I2PControl.h.orig | |
++++ daemon/I2PControl.h | |
+@@ -88,7 +88,7 @@ namespace client | |
+ bool m_IsRunning; | |
+ std::thread * m_Thread; | |
+ | |
+- boost::asio::io_service m_Service; | |
++ boost::asio::io_context m_Service; | |
+ boost::asio::ip::tcp::acceptor m_Acceptor; | |
+ boost::asio::ssl::context m_SSLContext; | |
+ boost::asio::deadline_timer m_ShutdownTimer; | |
blob - /dev/null | |
blob + c05f024bf8cb2dcbe460f32f6aacb48ccaa31506 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-daemon_UPnP_cpp | |
@@ -0,0 +1,24 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: daemon/UPnP.cpp | |
+--- daemon/UPnP.cpp.orig | |
++++ daemon/UPnP.cpp | |
+@@ -52,7 +52,7 @@ namespace transport | |
+ { | |
+ m_IsRunning = true; | |
+ LogPrint(eLogInfo, "UPnP: Starting"); | |
+- m_Service.post (std::bind (&UPnP::Discover, this)); | |
++ boost::asio::post (m_Service, std::bind (&UPnP::Discover, this)); | |
+ std::unique_lock<std::mutex> l(m_StartedMutex); | |
+ m_Thread.reset (new std::thread (std::bind (&UPnP::Run, this))); | |
+ m_Started.wait_for (l, std::chrono::seconds (5)); // 5 seconds maximum | |
+@@ -150,7 +150,7 @@ namespace transport | |
+ | |
+ // UPnP discovered | |
+ LogPrint (eLogDebug, "UPnP: ExternalIPAddress is ", m_externalIPAddress); | |
+- i2p::context.UpdateAddress (boost::asio::ip::address::from_string (m_externalIPAddress)); | |
++ i2p::context.UpdateAddress (boost::asio::ip::make_address (m_externalIPAddress)); | |
+ // port mapping | |
+ PortMapping (); | |
+ } | |
blob - /dev/null | |
blob + 7dfa4bfee3cccdae07bd6ba597758c9cde73a6c3 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-daemon_UPnP_h | |
@@ -0,0 +1,15 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: daemon/UPnP.h | |
+--- daemon/UPnP.h.orig | |
++++ daemon/UPnP.h | |
+@@ -67,7 +67,7 @@ namespace transport | |
+ std::unique_ptr<std::thread> m_Thread; | |
+ std::condition_variable m_Started; | |
+ std::mutex m_StartedMutex; | |
+- boost::asio::io_service m_Service; | |
++ boost::asio::io_context m_Service; | |
+ boost::asio::deadline_timer m_Timer; | |
+ bool m_upnpUrlsInitialized = false; | |
+ struct UPNPUrls m_upnpUrls; | |
blob - /dev/null | |
blob + 7450631b5dfc8472fe18efaf20031ce86d9277f1 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Destination_cpp | |
@@ -0,0 +1,137 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Destination.cpp | |
+--- libi2pd/Destination.cpp.orig | |
++++ libi2pd/Destination.cpp | |
+@@ -23,7 +23,7 @@ namespace i2p | |
+ { | |
+ 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): | |
+ m_Service (service), m_IsPublic (isPublic), m_PublishReplyToken (0), | |
+ m_LastSubmissionTime (0), m_PublishConfirmationTimer (m_Service), | |
+@@ -294,7 +294,7 @@ namespace client | |
+ if (m_IsPublic) | |
+ { | |
+ auto s = shared_from_this (); | |
+- m_Service.post ([s](void) | |
++ boost::asio::post (m_Service, [s](void) | |
+ { | |
+ s->m_PublishVerificationTimer.cancel (); | |
+ s->Publish (); | |
+@@ -322,7 +322,7 @@ namespace client | |
+ memcpy (data.k, key, 32); | |
+ memcpy (data.t, tag, 32); | |
+ auto s = shared_from_this (); | |
+- m_Service.post ([s,data](void) | |
++ boost::asio::post (m_Service, [s,data](void) | |
+ { | |
+ s->AddSessionKey (data.k, data.t); | |
+ }); | |
+@@ -339,7 +339,7 @@ namespace client | |
+ memcpy (data.k, key, 32); | |
+ data.t = tag; | |
+ auto s = shared_from_this (); | |
+- m_Service.post ([s,data](void) | |
++ boost::asio::post (m_Service, [s,data](void) | |
+ { | |
+ s->AddECIESx25519Key (data.k, data.t); | |
+ }); | |
+@@ -347,13 +347,13 @@ namespace client | |
+ | |
+ void LeaseSetDestination::ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg) | |
+ { | |
+- m_Service.post (std::bind (&LeaseSetDestination::HandleGarlicMessage, shared_from_this (), msg)); | |
++ boost::asio::post (m_Service, std::bind (&LeaseSetDestination::HandleGarlicMessage, shared_from_this (), msg)); | |
+ } | |
+ | |
+ void LeaseSetDestination::ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg) | |
+ { | |
+ uint32_t msgID = bufbe32toh (msg->GetPayload () + DELIVERY_STATUS_MSGID_OFFSET); | |
+- m_Service.post (std::bind (&LeaseSetDestination::HandleDeliveryStatusMessage, shared_from_this (), msgID)); | |
++ boost::asio::post (m_Service, std::bind (&LeaseSetDestination::HandleDeliveryStatusMessage, shared_from_this (), msgID)); | |
+ } | |
+ | |
+ void LeaseSetDestination::HandleI2NPMessage (const uint8_t * buf, size_t len) | |
+@@ -670,7 +670,7 @@ namespace client | |
+ auto s = shared_from_this (); | |
+ msg->onDrop = [s]() | |
+ { | |
+- s->GetService ().post([s]() | |
++ boost::asio::post (s->GetService (), [s]() | |
+ { | |
+ s->m_PublishConfirmationTimer.cancel (); | |
+ s->HandlePublishConfirmationTimer (boost::system::error_code()); | |
+@@ -755,10 +755,10 @@ namespace client | |
+ if (!m_Pool || !IsReady ()) | |
+ { | |
+ if (requestComplete) | |
+- m_Service.post ([requestComplete](void){requestComplete (nullptr);}); | |
++ boost::asio::post (m_Service, [requestComplete](void){requestComplete (nullptr);}); | |
+ return false; | |
+ } | |
+- m_Service.post (std::bind (&LeaseSetDestination::RequestLeaseSet, shared_from_this (), dest, requestComplete, nullptr)); | |
++ boost::asio::post (m_Service, std::bind (&LeaseSetDestination::RequestLeaseSet, shared_from_this (), dest, requestComplete, nullptr)); | |
+ return true; | |
+ } | |
+ | |
+@@ -767,7 +767,7 @@ namespace client | |
+ if (!dest || !m_Pool || !IsReady ()) | |
+ { | |
+ if (requestComplete) | |
+- m_Service.post ([requestComplete](void){requestComplete (nullptr);}); | |
++ boost::asio::post (m_Service, [requestComplete](void){requestComplete (nullptr);}); | |
+ return false; | |
+ } | |
+ auto storeHash = dest->GetStoreHash (); | |
+@@ -775,17 +775,17 @@ namespace client | |
+ if (leaseSet) | |
+ { | |
+ if (requestComplete) | |
+- m_Service.post ([requestComplete, leaseSet](void){requestComplete (leaseSet);}); | |
++ boost::asio::post (m_Service, [requestComplete, leaseSet](void){requestComplete (leaseSet);}); | |
+ return true; | |
+ } | |
+- m_Service.post (std::bind (&LeaseSetDestination::RequestLeaseSet, shared_from_this (), storeHash, requestComplete, dest)); | |
++ boost::asio::post (m_Service, std::bind (&LeaseSetDestination::RequestLeaseSet, shared_from_this (), storeHash, requestComplete, dest)); | |
+ return true; | |
+ } | |
+ | |
+ void LeaseSetDestination::CancelDestinationRequest (const i2p::data::IdentHash& dest, bool notify) | |
+ { | |
+ auto s = shared_from_this (); | |
+- m_Service.post ([dest, notify, s](void) | |
++ boost::asio::post (m_Service, [dest, notify, s](void) | |
+ { | |
+ auto it = s->m_LeaseSetRequests.find (dest); | |
+ if (it != s->m_LeaseSetRequests.end ()) | |
+@@ -883,7 +883,7 @@ namespace client | |
+ auto s = shared_from_this (); | |
+ msg->onDrop = [s, dest, request]() | |
+ { | |
+- s->GetService ().post([s, dest, request]() | |
++ boost::asio::post (s->GetService (), [s, dest, request]() | |
+ { | |
+ s->SendNextLeaseSetRequest (dest, request); | |
+ }); | |
+@@ -979,7 +979,7 @@ namespace client | |
+ 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): | |
+ LeaseSetDestination (service, isPublic, params), | |
+ m_Keys (keys), m_StreamingAckDelay (DEFAULT_INITIAL_ACK_DELAY), | |
+@@ -1191,7 +1191,7 @@ namespace client | |
+ if (leaseSet) | |
+ { | |
+ auto stream = CreateStream (leaseSet, port); | |
+- GetService ().post ([streamRequestComplete, stream]() | |
++ boost::asio::post (GetService (), [streamRequestComplete, stream]() | |
+ { | |
+ streamRequestComplete(stream); | |
+ }); | |
blob - /dev/null | |
blob + ba353efed4b270fffce640cc5ba9a81936822449 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Destination_h | |
@@ -0,0 +1,46 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Destination.h | |
+--- libi2pd/Destination.h.orig | |
++++ libi2pd/Destination.h | |
+@@ -104,7 +104,7 @@ namespace client | |
+ // leaseSet = nullptr means not found | |
+ 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; | |
+ uint64_t requestTime; | |
+ boost::asio::deadline_timer requestTimeoutTimer; | |
+@@ -122,10 +122,10 @@ namespace client | |
+ | |
+ 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 (); | |
+ const std::string& GetNickname () const { return m_Nickname; }; | |
+- boost::asio::io_service& GetService () { return m_Service; }; | |
++ boost::asio::io_context& GetService () { return m_Service; }; | |
+ | |
+ virtual void Start (); | |
+ virtual void Stop (); | |
+@@ -192,7 +192,7 @@ namespace client | |
+ | |
+ private: | |
+ | |
+- boost::asio::io_service& m_Service; | |
++ boost::asio::io_context& m_Service; | |
+ 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<LeaseSetRequest> > m_LeaseSetRequests; | |
+@@ -235,7 +235,7 @@ namespace client | |
+ | |
+ 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); | |
+ ~ClientDestination (); | |
+ | |
blob - /dev/null | |
blob + dd71ba5c10fec4e718d84c6f63937fe80a0f35e8 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_NTCP2_cpp | |
@@ -0,0 +1,86 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/NTCP2.cpp | |
+--- libi2pd/NTCP2.cpp.orig | |
++++ libi2pd/NTCP2.cpp | |
+@@ -404,7 +404,7 @@ namespace transport | |
+ | |
+ void NTCP2Session::Done () | |
+ { | |
+- m_Server.GetService ().post (std::bind (&NTCP2Session::Terminate, shared_from_this ())); | |
++ boost::asio::post (m_Server.GetService (), std::bind (&NTCP2Session::Terminate, shared_from_this ())); | |
+ } | |
+ | |
+ void NTCP2Session::Established () | |
+@@ -506,7 +506,7 @@ namespace transport | |
+ { | |
+ // we don't care about padding, send SessionCreated and close session | |
+ SendSessionCreated (); | |
+- m_Server.GetService ().post (std::bind (&NTCP2Session::Terminate, shared_from_this ())); | |
++ boost::asio::post (m_Server.GetService (), std::bind (&NTCP2Session::Terminate, shared_from_this ())); | |
+ } | |
+ else if (paddingLen > 0) | |
+ { | |
+@@ -1294,12 +1294,12 @@ namespace transport | |
+ void NTCP2Session::SendTerminationAndTerminate (NTCP2TerminationReason reason) | |
+ { | |
+ SendTermination (reason); | |
+- m_Server.GetService ().post (std::bind (&NTCP2Session::Terminate, shared_from_this ())); // let termination message go | |
++ boost::asio::post (m_Server.GetService (), std::bind (&NTCP2Session::Terminate, shared_from_this ())); // let termination message go | |
+ } | |
+ | |
+ void NTCP2Session::SendI2NPMessages (const std::vector<std::shared_ptr<I2NPMessage> >& msgs) | |
+ { | |
+- m_Server.GetService ().post (std::bind (&NTCP2Session::PostI2NPMessages, shared_from_this (), msgs)); | |
++ boost::asio::post (m_Server.GetService (), std::bind (&NTCP2Session::PostI2NPMessages, shared_from_this (), msgs)); | |
+ } | |
+ | |
+ void NTCP2Session::PostI2NPMessages (std::vector<std::shared_ptr<I2NPMessage> > msgs) | |
+@@ -1326,7 +1326,7 @@ namespace transport | |
+ void NTCP2Session::SendLocalRouterInfo (bool update) | |
+ { | |
+ if (update || !IsOutgoing ()) // we send it in SessionConfirmed for outgoing session | |
+- m_Server.GetService ().post (std::bind (&NTCP2Session::SendRouterInfo, shared_from_this ())); | |
++ boost::asio::post (m_Server.GetService (), std::bind (&NTCP2Session::SendRouterInfo, shared_from_this ())); | |
+ } | |
+ | |
+ NTCP2Server::NTCP2Server (): | |
+@@ -1350,9 +1350,8 @@ namespace transport | |
+ { | |
+ LogPrint(eLogInfo, "NTCP2: Using proxy to connect to peers"); | |
+ // TODO: resolve proxy until it is resolved | |
+- boost::asio::ip::tcp::resolver::query q(m_ProxyAddress, std::to_string(m_ProxyPort)); | |
+ boost::system::error_code e; | |
+- auto itr = m_Resolver.resolve(q, e); | |
++ auto itr = m_Resolver.resolve(m_ProxyAddress, std::to_string(m_ProxyPort), e).cbegin(); | |
+ if(e) | |
+ LogPrint(eLogCritical, "NTCP2: Failed to resolve proxy ", e.message()); | |
+ else | |
+@@ -1517,7 +1516,7 @@ namespace transport | |
+ } | |
+ LogPrint (eLogDebug, "NTCP2: Connecting to ", conn->GetRemoteEndpoint (), | |
+ " (", i2p::data::GetIdentHashAbbreviation (conn->GetRemoteIdentity ()->GetIdentHash ()), ")"); | |
+- GetService ().post([this, conn]() | |
++ boost::asio::post (GetService (), [this, conn]() | |
+ { | |
+ if (this->AddNTCP2Session (conn)) | |
+ { | |
+@@ -1738,7 +1737,7 @@ namespace transport | |
+ LogPrint (eLogError, "NTCP2: Can't connect to unspecified address"); | |
+ return; | |
+ } | |
+- GetService().post([this, conn]() | |
++ boost::asio::post (GetService(), [this, conn]() | |
+ { | |
+ if (this->AddNTCP2Session (conn)) | |
+ { | |
+@@ -1836,7 +1835,7 @@ namespace transport | |
+ { | |
+ readbuff->commit(transferred); | |
+ i2p::http::HTTPRes res; | |
+- if(res.parse(boost::asio::buffer_cast<const char*>(readbuff->data()), readbuff->size()) > 0) | |
++ if(res.parse(static_cast<const char*>(readbuff->data().data()), readbuff->size()) > 0) | |
+ { | |
+ if(res.code == 200) | |
+ { | |
blob - /dev/null | |
blob + f996c30359261046522fd4d3fedd959a6785fab1 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_NTCP2_h | |
@@ -0,0 +1,15 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/NTCP2.h | |
+--- libi2pd/NTCP2.h.orig | |
++++ libi2pd/NTCP2.h | |
+@@ -250,7 +250,7 @@ namespace transport | |
+ | |
+ void Start (); | |
+ void Stop (); | |
+- boost::asio::io_service& GetService () { return GetIOService (); }; | |
++ boost::asio::io_context& GetService () { return GetIOService (); }; | |
+ std::mt19937& GetRng () { return m_Rng; }; | |
+ | |
+ bool AddNTCP2Session (std::shared_ptr<NTCP2Session> session, bool incoming = false); | |
blob - /dev/null | |
blob + 638259b8fced989ed2b22078900400df99495e15 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_NetDbRequests_cpp | |
@@ -0,0 +1,42 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/NetDbRequests.cpp | |
+--- libi2pd/NetDbRequests.cpp.orig | |
++++ libi2pd/NetDbRequests.cpp | |
+@@ -179,7 +179,7 @@ namespace data | |
+ | |
+ void NetDbRequests::RequestComplete (const IdentHash& ident, std::shared_ptr<RouterInfo> r) | |
+ { | |
+- GetIOService ().post ([this, ident, r]() | |
++ boost::asio::post (GetIOService (), [this, ident, r]() | |
+ { | |
+ std::shared_ptr<RequestedDestination> request; | |
+ auto it = m_RequestedDestinations.find (ident); | |
+@@ -267,7 +267,7 @@ namespace data | |
+ { | |
+ if (dest->IsActive ()) | |
+ { | |
+- s->GetIOService ().post ([s, dest]() | |
++ boost::asio::post (s->GetIOService (), [s, dest]() | |
+ { | |
+ if (dest->IsActive ()) s->SendNextRequest (dest); | |
+ }); | |
+@@ -345,7 +345,7 @@ namespace data | |
+ | |
+ void NetDbRequests::PostDatabaseSearchReplyMsg (std::shared_ptr<const I2NPMessage> msg) | |
+ { | |
+- GetIOService ().post ([this, msg]() | |
++ boost::asio::post (GetIOService (), [this, msg]() | |
+ { | |
+ HandleDatabaseSearchReplyMsg (msg); | |
+ }); | |
+@@ -431,7 +431,7 @@ namespace data | |
+ void NetDbRequests::PostRequestDestination (const IdentHash& destination, | |
+ const RequestedDestination::RequestComplete& requestComplete, bool direct) | |
+ { | |
+- GetIOService ().post ([this, destination, requestComplete, direct]() | |
++ boost::asio::post (GetIOService (), [this, destination, requestComplete, direct]() | |
+ { | |
+ RequestDestination (destination, requestComplete, direct); | |
+ }); | |
blob - /dev/null | |
blob + fc23c0b0c19b96446b7e013fc5bb5a245dcb5555 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Reseed_cpp | |
@@ -0,0 +1,74 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Reseed.cpp | |
+--- libi2pd/Reseed.cpp.orig | |
++++ libi2pd/Reseed.cpp | |
+@@ -552,7 +552,7 @@ namespace data | |
+ if (!url.port) | |
+ url.port = 443; | |
+ | |
+- boost::asio::io_service service; | |
++ boost::asio::io_context service; | |
+ boost::system::error_code ecode; | |
+ | |
+ boost::asio::ssl::context ctx(boost::asio::ssl::context::sslv23); | |
+@@ -563,7 +563,7 @@ namespace data | |
+ { | |
+ // proxy connection | |
+ auto it = boost::asio::ip::tcp::resolver(service).resolve ( | |
+- boost::asio::ip::tcp::resolver::query (proxyUrl.host, std::to_string(proxyUrl.port)), ecode); | |
++ proxyUrl.host, std::to_string(proxyUrl.port), ecode).cbegin(); | |
+ if(!ecode) | |
+ { | |
+ s.lowest_layer().connect(*it, ecode); | |
+@@ -599,7 +599,7 @@ namespace data | |
+ LogPrint(eLogError, "Reseed: HTTP CONNECT read error: ", ecode.message()); | |
+ return ""; | |
+ } | |
+- if(proxyRes.parse(boost::asio::buffer_cast<const char *>(readbuf.data()), readbuf.size()) <= 0) | |
++ if(proxyRes.parse(static_cast<const char *>(readbuf.data().data()), readbuf.size()) <= 0) | |
+ { | |
+ sock.close(); | |
+ LogPrint(eLogError, "Reseed: HTTP CONNECT malformed reply"); | |
+@@ -638,13 +638,13 @@ namespace data | |
+ else | |
+ { | |
+ // direct connection | |
+- auto it = boost::asio::ip::tcp::resolver(service).resolve ( | |
+- boost::asio::ip::tcp::resolver::query (url.host, std::to_string(url.port)), ecode); | |
++ auto r = boost::asio::ip::tcp::resolver(service).resolve ( | |
++ url.host, std::to_string(url.port), ecode); | |
++ auto it = r.cbegin(); | |
+ if (!ecode) | |
+ { | |
+ bool connected = false; | |
+- boost::asio::ip::tcp::resolver::iterator end; | |
+- while (it != end) | |
++ while (it != r.cend()) | |
+ { | |
+ boost::asio::ip::tcp::endpoint ep = *it; | |
+ bool supported = false; | |
+@@ -746,17 +746,17 @@ namespace data | |
+ if (!url.port) url.port = 80; | |
+ | |
+ 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()); | |
+ | |
+- auto it = boost::asio::ip::tcp::resolver(service).resolve ( | |
+- boost::asio::ip::tcp::resolver::query (url.host, std::to_string(url.port)), ecode); | |
++ auto r = boost::asio::ip::tcp::resolver(service).resolve ( | |
++ url.host, std::to_string(url.port), ecode); | |
++ auto it = r.cbegin(); | |
+ | |
+ if (!ecode) | |
+ { | |
+ bool connected = false; | |
+- boost::asio::ip::tcp::resolver::iterator end; | |
+- while (it != end) | |
++ while (it != r.cend()) | |
+ { | |
+ boost::asio::ip::tcp::endpoint ep = *it; | |
+ if ( | |
blob - /dev/null | |
blob + 8d704ecd84b34c462dc55ac5624e5676b422461d (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_RouterContext_cpp | |
@@ -0,0 +1,114 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/RouterContext.cpp | |
+--- libi2pd/RouterContext.cpp.orig | |
++++ libi2pd/RouterContext.cpp | |
+@@ -140,7 +140,7 @@ namespace i2p | |
+ { | |
+ boost::asio::ip::address addr; | |
+ if (!host.empty ()) | |
+- addr = boost::asio::ip::address::from_string (host); | |
++ addr = boost::asio::ip::make_address (host); | |
+ if (!addr.is_v4()) | |
+ addr = boost::asio::ip::address_v4 (); | |
+ routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, addr, ntcp2Port); | |
+@@ -161,7 +161,7 @@ namespace i2p | |
+ { | |
+ boost::asio::ip::address addr; | |
+ if (!host.empty ()) | |
+- addr = boost::asio::ip::address::from_string (host); | |
++ addr = boost::asio::ip::make_address (host); | |
+ if (!addr.is_v4()) | |
+ addr = boost::asio::ip::address_v4 (); | |
+ routerInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, m_SSU2Keys->intro, addr, ssu2Port); | |
+@@ -192,7 +192,7 @@ namespace i2p | |
+ ntcp2Host = host; | |
+ boost::asio::ip::address addr; | |
+ if (!ntcp2Host.empty ()) | |
+- addr = boost::asio::ip::address::from_string (ntcp2Host); | |
++ addr = boost::asio::ip::make_address (ntcp2Host); | |
+ if (!addr.is_v6()) | |
+ addr = boost::asio::ip::address_v6 (); | |
+ routerInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, addr, ntcp2Port); | |
+@@ -211,7 +211,7 @@ namespace i2p | |
+ { | |
+ boost::asio::ip::address addr; | |
+ if (!host.empty ()) | |
+- addr = boost::asio::ip::address::from_string (host); | |
++ addr = boost::asio::ip::make_address (host); | |
+ if (!addr.is_v6()) | |
+ addr = boost::asio::ip::address_v6 (); | |
+ routerInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, m_SSU2Keys->intro, addr, ssu2Port); | |
+@@ -800,7 +800,7 @@ namespace i2p | |
+ i2p::config::GetOption("host", ntcp2Host); | |
+ if (!ntcp2Host.empty () && ntcp2Port) | |
+ { | |
+- auto addr = boost::asio::ip::address::from_string (ntcp2Host); | |
++ auto addr = boost::asio::ip::make_address (ntcp2Host); | |
+ if (addr.is_v6 ()) | |
+ { | |
+ m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, addr, ntcp2Port); | |
+@@ -829,7 +829,7 @@ namespace i2p | |
+ std::string host; i2p::config::GetOption("host", host); | |
+ if (!host.empty ()) | |
+ { | |
+- auto addr = boost::asio::ip::address::from_string (host); | |
++ auto addr = boost::asio::ip::make_address (host); | |
+ if (addr.is_v6 ()) | |
+ { | |
+ m_RouterInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, m_SSU2Keys->intro, addr, ssu2Port); | |
+@@ -898,7 +898,7 @@ namespace i2p | |
+ std::string host; i2p::config::GetOption("host", host); | |
+ if (!host.empty ()) | |
+ { | |
+- auto addr = boost::asio::ip::address::from_string (host); | |
++ auto addr = boost::asio::ip::make_address (host); | |
+ if (addr.is_v4 ()) | |
+ { | |
+ m_RouterInfo.AddNTCP2Address (m_NTCP2Keys->staticPublicKey, m_NTCP2Keys->iv, addr, ntcp2Port); | |
+@@ -928,7 +928,7 @@ namespace i2p | |
+ std::string host; i2p::config::GetOption("host", host); | |
+ if (!host.empty ()) | |
+ { | |
+- auto addr = boost::asio::ip::address::from_string (host); | |
++ auto addr = boost::asio::ip::make_address (host); | |
+ if (addr.is_v4 ()) | |
+ { | |
+ m_RouterInfo.AddSSU2Address (m_SSU2Keys->staticPublicKey, m_SSU2Keys->intro, addr, ssu2Port); | |
+@@ -1183,7 +1183,7 @@ namespace i2p | |
+ void RouterContext::ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg) | |
+ { | |
+ if (m_Service) | |
+- m_Service->GetService ().post (std::bind (&RouterContext::PostGarlicMessage, this, msg)); | |
++ boost::asio::post (m_Service->GetService (), std::bind (&RouterContext::PostGarlicMessage, this, msg)); | |
+ else | |
+ LogPrint (eLogError, "Router: service is NULL"); | |
+ } | |
+@@ -1211,7 +1211,7 @@ namespace i2p | |
+ void RouterContext::ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg) | |
+ { | |
+ if (m_Service) | |
+- m_Service->GetService ().post (std::bind (&RouterContext::PostDeliveryStatusMessage, this, msg)); | |
++ boost::asio::post (m_Service->GetService (), std::bind (&RouterContext::PostDeliveryStatusMessage, this, msg)); | |
+ else | |
+ LogPrint (eLogError, "Router: service is NULL"); | |
+ } | |
+@@ -1240,7 +1240,7 @@ namespace i2p | |
+ } data; | |
+ memcpy (data.k, key, 32); | |
+ data.t = tag; | |
+- m_Service->GetService ().post ([this,data](void) | |
++ boost::asio::post (m_Service->GetService (), [this,data](void) | |
+ { | |
+ AddECIESx25519Key (data.k, data.t); | |
+ }); | |
+@@ -1406,7 +1406,7 @@ namespace i2p | |
+ auto onDrop = [this]() | |
+ { | |
+ if (m_Service) | |
+- m_Service->GetService ().post ([this]() { HandlePublishResendTimer (boost::system::error_code ()); }); | |
++ boost::asio::post (m_Service->GetService (), [this]() { HandlePublishResendTimer (boost::system::error_code ()); }); | |
+ }; | |
+ if (i2p::transport::transports.IsConnected (floodfill->GetIdentHash ()) || // already connected | |
+ (floodfill->IsReachableFrom (i2p::context.GetRouterInfo ()) && // are we able to connect | |
blob - /dev/null | |
blob + 884d3444ab3a4ef1f27a23dab61a33ccfbe5c6c6 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_RouterContext_h | |
@@ -0,0 +1,15 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/RouterContext.h | |
+--- libi2pd/RouterContext.h.orig | |
++++ libi2pd/RouterContext.h | |
+@@ -90,7 +90,7 @@ namespace garlic | |
+ public: | |
+ | |
+ RouterService (): RunnableServiceWithWork ("Router") {}; | |
+- boost::asio::io_service& GetService () { return GetIOService (); }; | |
++ boost::asio::io_context& GetService () { return GetIOService (); }; | |
+ void Start () { StartIOService (); }; | |
+ void Stop () { StopIOService (); }; | |
+ }; | |
blob - /dev/null | |
blob + b3c5cd2c3a3fb2cc30e5f4b4c832a36215e5efba (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_RouterInfo_cpp | |
@@ -0,0 +1,12 @@ | |
+Index: libi2pd/RouterInfo.cpp | |
+--- libi2pd/RouterInfo.cpp.orig | |
++++ libi2pd/RouterInfo.cpp | |
+@@ -256,7 +256,7 @@ namespace data | |
+ if (!strcmp (key, "host")) | |
+ { | |
+ boost::system::error_code ecode; | |
+- address->host = boost::asio::ip::address::from_string (value, ecode); | |
++ address->host = boost::asio::ip::make_address (value, ecode); | |
+ if (!ecode && !address->host.is_unspecified ()) | |
+ { | |
+ if (!i2p::transport::transports.IsInReservedRange (address->host) || | |
blob - /dev/null | |
blob + b2e619c5c2a6d4953ee9ed16090b9cac961627ca (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_SSU2Session_cpp | |
@@ -0,0 +1,42 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/SSU2Session.cpp | |
+--- libi2pd/SSU2Session.cpp.orig | |
++++ libi2pd/SSU2Session.cpp | |
+@@ -343,7 +343,7 @@ namespace transport | |
+ | |
+ void SSU2Session::Done () | |
+ { | |
+- m_Server.GetService ().post (std::bind (&SSU2Session::Terminate, shared_from_this ())); | |
++ boost::asio::post (m_Server.GetService (), std::bind (&SSU2Session::Terminate, shared_from_this ())); | |
+ } | |
+ | |
+ void SSU2Session::SendLocalRouterInfo (bool update) | |
+@@ -351,7 +351,7 @@ namespace transport | |
+ if (update || !IsOutgoing ()) | |
+ { | |
+ auto s = shared_from_this (); | |
+- m_Server.GetService ().post ([s]() | |
++ boost::asio::post (m_Server.GetService (), [s]() | |
+ { | |
+ if (!s->IsEstablished ()) return; | |
+ uint8_t payload[SSU2_MAX_PACKET_SIZE]; | |
+@@ -371,7 +371,7 @@ namespace transport | |
+ | |
+ void SSU2Session::SendI2NPMessages (const std::vector<std::shared_ptr<I2NPMessage> >& msgs) | |
+ { | |
+- m_Server.GetService ().post (std::bind (&SSU2Session::PostI2NPMessages, shared_from_this (), msgs)); | |
++ boost::asio::post (m_Server.GetService (), std::bind (&SSU2Session::PostI2NPMessages, shared_from_this (), msgs)); | |
+ } | |
+ | |
+ void SSU2Session::PostI2NPMessages (std::vector<std::shared_ptr<I2NPMessage> > msgs) | |
+@@ -2051,7 +2051,7 @@ namespace transport | |
+ auto vec = std::make_shared<std::vector<uint8_t> >(len); | |
+ memcpy (vec->data (), buf, len); | |
+ auto s = shared_from_this (); | |
+- m_Server.GetService ().post ([s, vec, attempts]() | |
++ boost::asio::post (m_Server.GetService (), [s, vec, attempts]() | |
+ { | |
+ LogPrint (eLogDebug, "SSU2: RelayIntro attempt ", attempts + 1); | |
+ s->HandleRelayIntro (vec->data (), vec->size (), attempts + 1); | |
blob - /dev/null | |
blob + 079351238a5c3fb61450aaa37f358ae31a9aa9cf (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_SSU2_cpp | |
@@ -0,0 +1,94 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/SSU2.cpp | |
+--- libi2pd/SSU2.cpp.orig | |
++++ libi2pd/SSU2.cpp | |
+@@ -81,7 +81,7 @@ namespace transport | |
+ found = true; | |
+ LogPrint (eLogDebug, "SSU2: Opening IPv4 socket at Start"); | |
+ OpenSocket (boost::asio::ip::udp::endpoint (m_AddressV4, port)); | |
+- m_ReceiveService.GetService ().post( | |
++ boost::asio::post (m_ReceiveService.GetService (), | |
+ [this]() | |
+ { | |
+ Receive (m_SocketV4); | |
+@@ -93,7 +93,7 @@ namespace transport | |
+ found = true; | |
+ LogPrint (eLogDebug, "SSU2: Opening IPv6 socket at Start"); | |
+ OpenSocket (boost::asio::ip::udp::endpoint (m_AddressV6, port)); | |
+- m_ReceiveService.GetService ().post( | |
++ boost::asio::post (m_ReceiveService.GetService (), | |
+ [this]() | |
+ { | |
+ Receive (m_SocketV6); | |
+@@ -398,10 +398,10 @@ namespace transport | |
+ break; | |
+ } | |
+ } | |
+- GetService ().post (std::bind (&SSU2Server::HandleReceivedPackets, this, packets)); | |
++ boost::asio::post (GetService (), std::bind (&SSU2Server::HandleReceivedPackets, this, packets)); | |
+ } | |
+ else | |
+- GetService ().post (std::bind (&SSU2Server::HandleReceivedPacket, this, packet)); | |
++ boost::asio::post (GetService (), std::bind (&SSU2Server::HandleReceivedPacket, this, packet)); | |
+ Receive (socket); | |
+ } | |
+ else | |
+@@ -497,7 +497,7 @@ namespace transport | |
+ | |
+ void SSU2Server::RequestRemoveSession (uint64_t connID) | |
+ { | |
+- GetService ().post ([connID, this]() { RemoveSession (connID); }); | |
++ boost::asio::post (GetService (), [connID, this]() { RemoveSession (connID); }); | |
+ } | |
+ | |
+ void SSU2Server::AddSessionByRouterHash (std::shared_ptr<SSU2Session> session) | |
+@@ -525,7 +525,7 @@ namespace transport | |
+ // move unsent msgs to new session | |
+ oldSession->MoveSendQueue (session); | |
+ // terminate existing | |
+- GetService ().post (std::bind (&SSU2Session::RequestTermination, oldSession, eSSU2TerminationReasonReplacedByNewSession)); | |
++ boost::asio::post (GetService (), std::bind (&SSU2Session::RequestTermination, oldSession, eSSU2TerminationReasonReplacedByNewSession)); | |
+ } | |
+ } | |
+ } | |
+@@ -827,7 +827,7 @@ namespace transport | |
+ { | |
+ // session with router found, trying to send peer test if requested | |
+ if (peerTest && existingSession->IsEstablished ()) | |
+- GetService ().post ([existingSession]() { existingSession->SendPeerTest (); }); | |
++ boost::asio::post (GetService (), [existingSession]() { existingSession->SendPeerTest (); }); | |
+ return false; | |
+ } | |
+ // check is no pending session | |
+@@ -860,9 +860,9 @@ namespace transport | |
+ session->SetOnEstablished ([session]() {session->SendPeerTest (); }); | |
+ | |
+ if (address->UsesIntroducer ()) | |
+- GetService ().post (std::bind (&SSU2Server::ConnectThroughIntroducer, this, session)); | |
++ boost::asio::post (GetService (), std::bind (&SSU2Server::ConnectThroughIntroducer, this, session)); | |
+ else if (isValidEndpoint) // we can't connect without endpoint | |
+- GetService ().post ([session]() { session->Connect (); }); | |
++ boost::asio::post (GetService (), [session]() { session->Connect (); }); | |
+ else | |
+ return false; | |
+ } | |
+@@ -1005,7 +1005,7 @@ namespace transport | |
+ if (!remoteAddr || !remoteAddr->IsPeerTesting () || | |
+ (v4 && !remoteAddr->IsV4 ()) || (!v4 && !remoteAddr->IsV6 ())) return false; | |
+ if (session->IsEstablished ()) | |
+- GetService ().post ([session]() { session->SendPeerTest (); }); | |
++ boost::asio::post (GetService (), [session]() { session->SendPeerTest (); }); | |
+ else | |
+ session->SetOnEstablished ([session]() { session->SendPeerTest (); }); | |
+ return true; | |
+@@ -1717,7 +1717,7 @@ namespace transport | |
+ bool SSU2Server::SetProxy (const std::string& address, uint16_t port) | |
+ { | |
+ boost::system::error_code ecode; | |
+- auto addr = boost::asio::ip::address::from_string (address, ecode); | |
++ auto addr = boost::asio::ip::make_address (address, ecode); | |
+ if (!ecode && !addr.is_unspecified () && port) | |
+ { | |
+ m_IsThroughProxy = true; | |
blob - /dev/null | |
blob + 017cc893de5013193b5c853f7c79fc113eaf0ed5 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_SSU2_h | |
@@ -0,0 +1,24 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/SSU2.h | |
+--- libi2pd/SSU2.h.orig | |
++++ libi2pd/SSU2.h | |
+@@ -71,7 +71,7 @@ namespace transport | |
+ public: | |
+ | |
+ ReceiveService (const std::string& name): RunnableService (name) {}; | |
+- boost::asio::io_service& GetService () { return GetIOService (); }; | |
++ boost::asio::io_context& GetService () { return GetIOService (); }; | |
+ void Start () { StartIOService (); }; | |
+ void Stop () { StopIOService (); }; | |
+ }; | |
+@@ -83,7 +83,7 @@ namespace transport | |
+ | |
+ void Start (); | |
+ void Stop (); | |
+- boost::asio::io_service& GetService () { return GetIOService (); }; | |
++ boost::asio::io_context& GetService () { return GetIOService (); }; | |
+ void SetLocalAddress (const boost::asio::ip::address& localAddress); | |
+ bool SetProxy (const std::string& address, uint16_t port); | |
+ bool UsesProxy () const { return m_IsThroughProxy; }; | |
blob - /dev/null | |
blob + 685632792265a2420a30ac751df413e83c4ef43d (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Streaming_cpp | |
@@ -0,0 +1,78 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Streaming.cpp | |
+--- libi2pd/Streaming.cpp.orig | |
++++ libi2pd/Streaming.cpp | |
+@@ -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), | |
+ m_SendStreamID (0), m_SequenceNumber (0), m_DropWindowDelaySequenceNumber (0), | |
+ m_TunnelsChangeSequenceNumber (0), m_LastReceivedSequenceNumber (-1), m_PreviousReceivedSequenceNumber (-1), | |
+@@ -95,7 +95,7 @@ namespace stream | |
+ 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_TunnelsChangeSequenceNumber (0), m_LastReceivedSequenceNumber (-1), m_PreviousReceivedSequenceNumber (-1), | |
+ m_LastConfirmedReceivedSequenceNumber (0), // for limit inbound speed | |
+@@ -666,7 +666,7 @@ namespace stream | |
+ { | |
+ // make sure that AsycReceive complete | |
+ auto s = shared_from_this(); | |
+- m_Service.post ([s]() | |
++ boost::asio::post(m_Service, [s]() | |
+ { | |
+ s->m_ReceiveTimer.cancel (); | |
+ }); | |
+@@ -694,7 +694,7 @@ namespace stream | |
+ else if (handler) | |
+ handler(boost::system::error_code ()); | |
+ auto s = shared_from_this (); | |
+- m_Service.post ([s, buffer]() | |
++ boost::asio::post(m_Service, [s, buffer]() | |
+ { | |
+ if (buffer) | |
+ s->m_SendBuffer.Add (buffer); | |
+@@ -1056,7 +1056,7 @@ namespace stream | |
+ m_LocalDestination.GetOwner ()->Sign (packet, size, signature); | |
+ | |
+ p->len = size; | |
+- m_Service.post (std::bind (&Stream::SendPacket, shared_from_this (), p)); | |
++ boost::asio::post (m_Service, std::bind (&Stream::SendPacket, shared_from_this (), p)); | |
+ LogPrint (eLogDebug, "Streaming: FIN sent, sSID=", m_SendStreamID); | |
+ } | |
+ | |
+@@ -1767,7 +1767,7 @@ namespace stream | |
+ if (it == m_Streams.end ()) | |
+ return false; | |
+ auto s = it->second; | |
+- m_Owner->GetService ().post ([this, s] () | |
++ boost::asio::post (m_Owner->GetService (), [this, s] () | |
+ { | |
+ s->Close (); // try to send FIN | |
+ s->Terminate (false); | |
+@@ -1780,7 +1780,7 @@ namespace stream | |
+ { | |
+ m_Acceptor = acceptor; // we must set it immediately for IsAcceptorSet | |
+ auto s = shared_from_this (); | |
+- m_Owner->GetService ().post([s](void) | |
++ boost::asio::post (m_Owner->GetService (), [s](void) | |
+ { | |
+ // take care about incoming queue | |
+ for (auto& it: s->m_PendingIncomingStreams) | |
+@@ -1799,7 +1799,7 @@ namespace stream | |
+ | |
+ void StreamingDestination::AcceptOnce (const Acceptor& acceptor) | |
+ { | |
+- m_Owner->GetService ().post([acceptor, this](void) | |
++ boost::asio::post (m_Owner->GetService (), [acceptor, this](void) | |
+ { | |
+ if (!m_PendingIncomingStreams.empty ()) | |
+ { | |
blob - /dev/null | |
blob + 7ff8cd488eee0b1423f2ba186c9c144b655a912b (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Streaming_h | |
@@ -0,0 +1,54 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Streaming.h | |
+--- libi2pd/Streaming.h.orig | |
++++ libi2pd/Streaming.h | |
+@@ -174,9 +174,9 @@ namespace stream | |
+ { | |
+ 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 | |
+- Stream (boost::asio::io_service& service, StreamingDestination& local); // incoming | |
++ Stream (boost::asio::io_context& service, StreamingDestination& local); // incoming | |
+ | |
+ ~Stream (); | |
+ uint32_t GetSendStreamID () const { return m_SendStreamID; }; | |
+@@ -200,7 +200,7 @@ namespace stream | |
+ size_t ReadSome (uint8_t * buf, size_t len) { return ConcatenatePackets (buf, len); }; | |
+ size_t Receive (uint8_t * buf, size_t len, int timeout); | |
+ | |
+- void AsyncClose() { m_Service.post(std::bind(&Stream::Close, shared_from_this())); }; | |
++ void AsyncClose() { boost::asio::post(m_Service, std::bind(&Stream::Close, shared_from_this())); }; | |
+ | |
+ /** only call close from destination thread, use Stream::AsyncClose for other threads */ | |
+ void Close (); | |
+@@ -251,7 +251,7 @@ namespace stream | |
+ | |
+ private: | |
+ | |
+- boost::asio::io_service& m_Service; | |
++ boost::asio::io_context& m_Service; | |
+ uint32_t m_SendStreamID, m_RecvStreamID, m_SequenceNumber; | |
+ uint32_t m_DropWindowDelaySequenceNumber; | |
+ uint32_t m_TunnelsChangeSequenceNumber; | |
+@@ -368,7 +368,7 @@ namespace stream | |
+ void Stream::AsyncReceive (const Buffer& buffer, ReceiveHandler handler, int timeout) | |
+ { | |
+ auto s = shared_from_this(); | |
+- m_Service.post ([s, buffer, handler, timeout](void) | |
++ boost::asio::post(m_Service, [s, buffer, handler, timeout](void) | |
+ { | |
+ if (!s->m_ReceiveQueue.empty () || s->m_Status == eStreamStatusReset) | |
+ s->HandleReceiveTimer (boost::asio::error::make_error_code (boost::asio::error::operation_aborted), buffer, handler, 0); | |
+@@ -389,7 +389,7 @@ namespace stream | |
+ template<typename Buffer, typename ReceiveHandler> | |
+ void Stream::HandleReceiveTimer (const boost::system::error_code& ecode, const Buffer& buffer, ReceiveHandler handler, int remainingTimeout) | |
+ { | |
+- size_t received = ConcatenatePackets (boost::asio::buffer_cast<uint8_t *>(buffer), boost::asio::buffer_size(buffer)); | |
++ size_t received = ConcatenatePackets (static_cast<uint8_t *>(buffer.data()), boost::asio::buffer_size(buffer)); | |
+ if (received > 0) | |
+ handler (boost::system::error_code (), received); | |
+ else if (ecode == boost::asio::error::operation_aborted) | |
blob - /dev/null | |
blob + 60b69b1a7f315da51fc93d331e744c26d1314dbc (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Timestamp_cpp | |
@@ -0,0 +1,37 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Timestamp.cpp | |
+--- libi2pd/Timestamp.cpp.orig | |
++++ libi2pd/Timestamp.cpp | |
+@@ -60,16 +60,16 @@ namespace util | |
+ static void SyncTimeWithNTP (const std::string& address) | |
+ { | |
+ LogPrint (eLogInfo, "Timestamp: NTP request to ", address); | |
+- boost::asio::io_service service; | |
++ boost::asio::io_context service; | |
+ boost::system::error_code ec; | |
+- auto it = boost::asio::ip::udp::resolver (service).resolve ( | |
+- boost::asio::ip::udp::resolver::query (address, "ntp"), ec); | |
++ auto r = boost::asio::ip::udp::resolver (service).resolve ( | |
++ address, "ntp", ec); | |
++ auto it = r.cbegin(); | |
+ if (!ec) | |
+ { | |
+ bool found = false; | |
+- boost::asio::ip::udp::resolver::iterator end; | |
+ boost::asio::ip::udp::endpoint ep; | |
+- while (it != end) | |
++ while (it != r.cend()) | |
+ { | |
+ ep = *it; | |
+ if (!ep.address ().is_unspecified ()) | |
+@@ -154,7 +154,7 @@ namespace util | |
+ { | |
+ m_IsRunning = true; | |
+ LogPrint(eLogInfo, "Timestamp: NTP time sync starting"); | |
+- m_Service.post (std::bind (&NTPTimeSync::Sync, this)); | |
++ boost::asio::post (m_Service, std::bind (&NTPTimeSync::Sync, this)); | |
+ m_Thread.reset (new std::thread (std::bind (&NTPTimeSync::Run, this))); | |
+ } | |
+ else | |
blob - /dev/null | |
blob + e74dbd6f1f161d92f650ebeec63171cccf6d034b (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Timestamp_h | |
@@ -0,0 +1,15 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Timestamp.h | |
+--- libi2pd/Timestamp.h.orig | |
++++ libi2pd/Timestamp.h | |
+@@ -52,7 +52,7 @@ namespace util | |
+ | |
+ bool m_IsRunning; | |
+ 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; | |
+ int m_SyncInterval; | |
+ std::vector<std::string> m_NTPServersList; | |
blob - /dev/null | |
blob + 0b43fb141beddb522450cadb6a5a7957713e1daf (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Transports_cpp | |
@@ -0,0 +1,98 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Transports.cpp | |
+--- libi2pd/Transports.cpp.orig | |
++++ libi2pd/Transports.cpp | |
+@@ -174,8 +174,8 @@ namespace transport | |
+ { | |
+ if (!m_Service) | |
+ { | |
+- m_Service = new boost::asio::io_service (); | |
+- m_Work = new boost::asio::io_service::work (*m_Service); | |
++ m_Service = new boost::asio::io_context (); | |
++ m_Work = new boost::asio::executor_work_guard (boost::asio::make_work_guard (*m_Service)); | |
+ m_PeerCleanupTimer = 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); | |
+@@ -249,7 +249,7 @@ namespace transport | |
+ if (!address.empty ()) | |
+ { | |
+ boost::system::error_code ec; | |
+- auto addr = boost::asio::ip::address::from_string (address, ec); | |
++ auto addr = boost::asio::ip::make_address (address, ec); | |
+ if (!ec) | |
+ { | |
+ if (m_NTCP2Server) m_NTCP2Server->SetLocalAddress (addr); | |
+@@ -275,7 +275,7 @@ namespace transport | |
+ if (!address.empty ()) | |
+ { | |
+ boost::system::error_code ec; | |
+- auto addr = boost::asio::ip::address::from_string (address, ec); | |
++ auto addr = boost::asio::ip::make_address (address, ec); | |
+ if (!ec) | |
+ { | |
+ if (m_NTCP2Server) m_NTCP2Server->SetLocalAddress (addr); | |
+@@ -302,7 +302,7 @@ namespace transport | |
+ if (!address.empty ()) | |
+ { | |
+ boost::system::error_code ec; | |
+- auto addr = boost::asio::ip::address::from_string (address, ec); | |
++ auto addr = boost::asio::ip::make_address (address, ec); | |
+ if (!ec && m_NTCP2Server && i2p::util::net::IsYggdrasilAddress (addr)) | |
+ m_NTCP2Server->SetLocalAddress (addr); | |
+ } | |
+@@ -455,7 +455,7 @@ namespace transport | |
+ | |
+ void Transports::SendMessages (const i2p::data::IdentHash& ident, const std::vector<std::shared_ptr<i2p::I2NPMessage> >& msgs) | |
+ { | |
+- m_Service->post (std::bind (&Transports::PostMessages, this, ident, msgs)); | |
++ boost::asio::post(*m_Service, std::bind (&Transports::PostMessages, this, ident, msgs)); | |
+ } | |
+ | |
+ void Transports::PostMessages (i2p::data::IdentHash ident, std::vector<std::shared_ptr<i2p::I2NPMessage> > msgs) | |
+@@ -676,7 +676,7 @@ namespace transport | |
+ | |
+ void Transports::RequestComplete (std::shared_ptr<const i2p::data::RouterInfo> r, const i2p::data::IdentHash& ident) | |
+ { | |
+- m_Service->post (std::bind (&Transports::HandleRequestComplete, this, r, ident)); | |
++ boost::asio::post(*m_Service, std::bind (&Transports::HandleRequestComplete, this, r, ident)); | |
+ } | |
+ | |
+ void Transports::HandleRequestComplete (std::shared_ptr<const i2p::data::RouterInfo> r, i2p::data::IdentHash ident) | |
+@@ -807,7 +807,7 @@ namespace transport | |
+ | |
+ void Transports::PeerConnected (std::shared_ptr<TransportSession> session) | |
+ { | |
+- m_Service->post([session, this]() | |
++ boost::asio::post(*m_Service, [session, this]() | |
+ { | |
+ auto remoteIdentity = session->GetRemoteIdentity (); | |
+ if (!remoteIdentity) return; | |
+@@ -877,7 +877,7 @@ namespace transport | |
+ | |
+ void Transports::PeerDisconnected (std::shared_ptr<TransportSession> session) | |
+ { | |
+- m_Service->post([session, this]() | |
++ boost::asio::post(*m_Service, [session, this]() | |
+ { | |
+ auto remoteIdentity = session->GetRemoteIdentity (); | |
+ if (!remoteIdentity) return; | |
+@@ -1221,7 +1221,7 @@ namespace transport | |
+ std::string yggaddress; i2p::config::GetOption ("meshnets.yggaddress", yggaddress); | |
+ if (!yggaddress.empty ()) | |
+ { | |
+- yggaddr = boost::asio::ip::address_v6::from_string (yggaddress); | |
++ yggaddr = boost::asio::ip::make_address_v6 (yggaddress); | |
+ if (yggaddr.is_unspecified () || !i2p::util::net::IsYggdrasilAddress (yggaddr) || | |
+ !i2p::util::net::IsLocalAddress (yggaddr)) | |
+ { | |
+@@ -1266,7 +1266,7 @@ namespace transport | |
+ if (ipv6) | |
+ { | |
+ std::string ipv6Addr; i2p::config::GetOption("ntcp2.addressv6", ipv6Addr); | |
+- auto addr = boost::asio::ip::address_v6::from_string (ipv6Addr); | |
++ auto addr = boost::asio::ip::make_address_v6 (ipv6Addr); | |
+ if (!addr.is_unspecified () && addr != boost::asio::ip::address_v6::any ()) | |
+ i2p::context.UpdateNTCP2V6Address (addr); // set ipv6 address if configured | |
+ } | |
blob - /dev/null | |
blob + a7e2acb65e804e2d6a2ca4edd54d4043675fe74f (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_Transports_h | |
@@ -0,0 +1,26 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/Transports.h | |
+--- libi2pd/Transports.h.orig | |
++++ libi2pd/Transports.h | |
+@@ -136,7 +136,7 @@ namespace transport | |
+ bool IsOnline() const { return m_IsOnline; }; | |
+ void SetOnline (bool online); | |
+ | |
+- boost::asio::io_service& GetService () { return *m_Service; }; | |
++ boost::asio::io_context& GetService () { return *m_Service; }; | |
+ std::shared_ptr<i2p::crypto::X25519Keys> GetNextX25519KeysPair (); | |
+ void ReuseX25519KeysPair (std::shared_ptr<i2p::crypto::X25519Keys> pair); | |
+ | |
+@@ -203,8 +203,8 @@ namespace transport | |
+ volatile bool m_IsOnline; | |
+ bool m_IsRunning, m_IsNAT, m_CheckReserved; | |
+ std::thread * m_Thread; | |
+- boost::asio::io_service * m_Service; | |
+- boost::asio::io_service::work * m_Work; | |
++ boost::asio::io_context * m_Service; | |
++ boost::asio::executor_work_guard<boost::asio::io_context::executor_type> * m_Work; | |
+ boost::asio::deadline_timer * m_PeerCleanupTimer, * m_PeerTestTimer, * m_UpdateBandwidthTimer; | |
+ | |
+ SSU2Server * m_SSU2Server; | |
blob - /dev/null | |
blob + 40df25a6f6050212d7b4f8d150ee1ea34dcfa31d (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_BOB_cpp | |
@@ -0,0 +1,48 @@ | |
+Index: libi2pd_client/BOB.cpp | |
+--- libi2pd_client/BOB.cpp.orig | |
++++ libi2pd_client/BOB.cpp | |
+@@ -129,7 +129,7 @@ namespace client | |
+ | |
+ BOBI2POutboundTunnel::BOBI2POutboundTunnel (const std::string& outhost, uint16_t port, | |
+ std::shared_ptr<ClientDestination> localDestination, bool quiet): BOBI2PTunnel (localDestination), | |
+- m_Endpoint (boost::asio::ip::address::from_string (outhost), port), m_IsQuiet (quiet) | |
++ m_Endpoint (boost::asio::ip::make_address (outhost), port), m_IsQuiet (quiet) | |
+ { | |
+ } | |
+ | |
+@@ -220,7 +220,7 @@ namespace client | |
+ if (!inhost.empty ()) | |
+ { | |
+ boost::system::error_code ec; | |
+- auto addr = boost::asio::ip::address::from_string (inhost, ec); | |
++ auto addr = boost::asio::ip::make_address (inhost, ec); | |
+ if (!ec) | |
+ ep.address (addr); | |
+ else | |
+@@ -425,7 +425,7 @@ namespace client | |
+ { | |
+ // TODO: FIXME: temporary validation, until hostname support is added | |
+ boost::system::error_code ec; | |
+- boost::asio::ip::address::from_string(m_InHost, ec); | |
++ boost::asio::ip::make_address(m_InHost, ec); | |
+ if (ec) | |
+ { | |
+ SendReplyError("inhost must be a valid IPv4 address."); | |
+@@ -436,7 +436,7 @@ namespace client | |
+ { | |
+ // TODO: FIXME: temporary validation, until hostname support is added | |
+ boost::system::error_code ec; | |
+- boost::asio::ip::address::from_string(m_OutHost, ec); | |
++ boost::asio::ip::make_address(m_OutHost, ec); | |
+ if (ec) | |
+ { | |
+ SendReplyError("outhost must be a IPv4 address."); | |
+@@ -828,7 +828,7 @@ namespace client | |
+ | |
+ BOBCommandChannel::BOBCommandChannel (const std::string& address, uint16_t port): | |
+ RunnableService ("BOB"), | |
+- m_Acceptor (GetIOService (), boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(address), port)) | |
++ m_Acceptor (GetIOService (), boost::asio::ip::tcp::endpoint(boost::asio::ip::make_address(address), port)) | |
+ { | |
+ // command -> handler | |
+ m_CommandHandlers[BOB_COMMAND_ZAP] = &BOBCommandSession::ZapCommandHandler; | |
blob - /dev/null | |
blob + da853e6ac0ea5bb977aa105f7bc8c8a57dee9a7a (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_BOB_h | |
@@ -0,0 +1,15 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/BOB.h | |
+--- libi2pd_client/BOB.h.orig | |
++++ libi2pd_client/BOB.h | |
+@@ -254,7 +254,7 @@ namespace client | |
+ void Start (); | |
+ void Stop (); | |
+ | |
+- boost::asio::io_service& GetService () { return GetIOService (); }; | |
++ boost::asio::io_context& GetService () { return GetIOService (); }; | |
+ void AddDestination (const std::string& name, std::shared_ptr<BOBDestination> dest); | |
+ void DeleteDestination (const std::string& name); | |
+ std::shared_ptr<BOBDestination> FindDestination (const std::string& name); | |
blob - /dev/null | |
blob + 88254eb17762c28676ec727a75364939fbf41dec (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_ClientContext_cpp | |
@@ -0,0 +1,51 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/ClientContext.cpp | |
+--- libi2pd_client/ClientContext.cpp.orig | |
++++ libi2pd_client/ClientContext.cpp | |
+@@ -345,7 +345,7 @@ namespace client | |
+ } | |
+ | |
+ 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, | |
+ const std::map<std::string, std::string> * params) | |
+ { | |
+@@ -399,7 +399,7 @@ namespace client | |
+ 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) | |
+ { | |
+ auto it = m_Destinations.find (keys.GetPublic ()->GetIdentHash ()); | |
+@@ -623,7 +623,7 @@ namespace client | |
+ if (type == I2P_TUNNELS_SECTION_TYPE_UDPCLIENT) { | |
+ // udp client | |
+ // TODO: hostnames | |
+- boost::asio::ip::udp::endpoint end (boost::asio::ip::address::from_string(address), port); | |
++ boost::asio::ip::udp::endpoint end (boost::asio::ip::make_address(address), port); | |
+ if (!localDestination) | |
+ localDestination = m_SharedLocalDestination; | |
+ | |
+@@ -774,7 +774,7 @@ namespace client | |
+ { | |
+ // udp server tunnel | |
+ // TODO: hostnames | |
+- boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(host), port); | |
++ boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::make_address(host), port); | |
+ if (address.empty ()) | |
+ { | |
+ if (!endpoint.address ().is_unspecified () && endpoint.address ().is_v6 ()) | |
+@@ -782,7 +782,7 @@ namespace client | |
+ else | |
+ address = "127.0.0.1"; | |
+ } | |
+- auto localAddress = boost::asio::ip::address::from_string(address); | |
++ auto localAddress = boost::asio::ip::make_address(address); | |
+ auto serverTunnel = std::make_shared<I2PUDPServerTunnel>(name, localDestination, localAddress, endpoint, inPort, gzip); | |
+ if(!isUniqueLocal) | |
+ { | |
blob - /dev/null | |
blob + 8dc7352b38acccca26c086ab3dc70bcd7d2ba19c (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_ClientContext_h | |
@@ -0,0 +1,22 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/ClientContext.h | |
+--- libi2pd_client/ClientContext.h.orig | |
++++ libi2pd_client/ClientContext.h | |
+@@ -79,13 +79,13 @@ namespace client | |
+ i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519, | |
+ i2p::data::CryptoKeyType cryptoType = i2p::data::CRYPTO_KEY_TYPE_ELGAMAL, | |
+ 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, | |
+ 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 | |
+ std::shared_ptr<ClientDestination> CreateNewLocalDestination (const i2p::data::PrivateKeys& keys, bool isPublic = true, | |
+ 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 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, | |
blob - /dev/null | |
blob + cf130a6544dd02437af8231d31e6c3f7d419ca22 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_HTTPProxy_cpp | |
@@ -0,0 +1,45 @@ | |
+Index: libi2pd_client/HTTPProxy.cpp | |
+--- libi2pd_client/HTTPProxy.cpp.orig | |
++++ libi2pd_client/HTTPProxy.cpp | |
+@@ -98,7 +98,7 @@ namespace proxy { | |
+ | |
+ typedef std::function<void(boost::asio::ip::tcp::endpoint)> ProxyResolvedHandler; | |
+ | |
+- void HandleUpstreamProxyResolved(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::iterator itr, ProxyResolvedHandler handler); | |
++ void HandleUpstreamProxyResolved(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::results_type results, ProxyResolvedHandler handler); | |
+ | |
+ void SocksProxySuccess(); | |
+ void HandoverToUpstreamProxy(); | |
+@@ -584,8 +584,7 @@ namespace proxy { | |
+ } | |
+ else | |
+ { | |
+- boost::asio::ip::tcp::resolver::query q(m_ProxyURL.host, std::to_string(m_ProxyURL.port)); | |
+- m_proxy_resolver.async_resolve(q, std::bind(&HTTPReqHandler::HandleUpstreamProxyResolved, this, std::placeholders::_1, std::placeholders::_2, [&](boost::asio::ip::tcp::endpoint ep) { | |
++ m_proxy_resolver.async_resolve(m_ProxyURL.host, std::to_string(m_ProxyURL.port), std::bind(&HTTPReqHandler::HandleUpstreamProxyResolved, this, std::placeholders::_1, std::placeholders::_2, [&](boost::asio::ip::tcp::endpoint ep) { | |
+ m_proxysock->async_connect(ep, std::bind(&HTTPReqHandler::HandleUpstreamHTTPProxyConnect, this, std::placeholders::_1)); | |
+ })); | |
+ } | |
+@@ -594,8 +593,7 @@ namespace proxy { | |
+ { | |
+ /* handle upstream socks proxy */ | |
+ if (!m_ProxyURL.port) m_ProxyURL.port = 9050; // default to tor default if not specified | |
+- boost::asio::ip::tcp::resolver::query q(m_ProxyURL.host, std::to_string(m_ProxyURL.port)); | |
+- m_proxy_resolver.async_resolve(q, std::bind(&HTTPReqHandler::HandleUpstreamProxyResolved, this, std::placeholders::_1, std::placeholders::_2, [&](boost::asio::ip::tcp::endpoint ep) { | |
++ m_proxy_resolver.async_resolve(m_ProxyURL.host, std::to_string(m_ProxyURL.port), std::bind(&HTTPReqHandler::HandleUpstreamProxyResolved, this, std::placeholders::_1, std::placeholders::_2, [&](boost::asio::ip::tcp::endpoint ep) { | |
+ m_proxysock->async_connect(ep, std::bind(&HTTPReqHandler::HandleUpstreamSocksProxyConnect, this, std::placeholders::_1)); | |
+ })); | |
+ } | |
+@@ -606,10 +604,10 @@ namespace proxy { | |
+ } | |
+ } | |
+ | |
+- void HTTPReqHandler::HandleUpstreamProxyResolved(const boost::system::error_code & ec, boost::asio::ip::tcp::resolver::iterator it, ProxyResolvedHandler handler) | |
++ void HTTPReqHandler::HandleUpstreamProxyResolved(const boost::system::error_code & ec, boost::asio::ip::tcp::resolver::results_type results, ProxyResolvedHandler handler) | |
+ { | |
+ if(ec) GenericProxyError(tr("Cannot resolve upstream proxy"), ec.message()); | |
+- else handler(*it); | |
++ else handler(*results.cbegin()); | |
+ } | |
+ | |
+ void HTTPReqHandler::HandleUpstreamSocksProxyConnect(const boost::system::error_code & ec) | |
blob - /dev/null | |
blob + 63e50851e635536315c8c37f1d7796ebc8750150 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_I2CP_cpp | |
@@ -0,0 +1,42 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/I2CP.cpp | |
+--- libi2pd_client/I2CP.cpp.orig | |
++++ libi2pd_client/I2CP.cpp | |
+@@ -24,7 +24,7 @@ namespace i2p | |
+ 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, | |
+ const std::map<std::string, std::string>& params): | |
+ LeaseSetDestination (service, isPublic, ¶ms), | |
+@@ -88,7 +88,7 @@ namespace client | |
+ | |
+ void I2CPDestination::CreateNewLeaseSet (const std::vector<std::shared_ptr<i2p::tunnel::InboundTunnel> >& tunnels) | |
+ { | |
+- GetService ().post (std::bind (&I2CPDestination::PostCreateNewLeaseSet, this, tunnels)); | |
++ boost::asio::post (GetService (), std::bind (&I2CPDestination::PostCreateNewLeaseSet, this, tunnels)); | |
+ } | |
+ | |
+ void I2CPDestination::PostCreateNewLeaseSet (std::vector<std::shared_ptr<i2p::tunnel::InboundTunnel> > tunnels) | |
+@@ -170,7 +170,7 @@ namespace client | |
+ { | |
+ // send in destination's thread | |
+ auto s = GetSharedFromThis (); | |
+- GetService ().post ( | |
++ boost::asio::post (GetService (), | |
+ [s, msg, remote, nonce]() | |
+ { | |
+ bool sent = s->SendMsg (msg, remote); | |
+@@ -1079,7 +1079,7 @@ namespace client | |
+ I2CPServer::I2CPServer (const std::string& interface, uint16_t port, bool isSingleThread): | |
+ RunnableService ("I2CP"), m_IsSingleThread (isSingleThread), | |
+ m_Acceptor (GetIOService (), | |
+- boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(interface), port)) | |
++ boost::asio::ip::tcp::endpoint(boost::asio::ip::make_address(interface), port)) | |
+ { | |
+ memset (m_MessagesHandlers, 0, sizeof (m_MessagesHandlers)); | |
+ m_MessagesHandlers[I2CP_GET_DATE_MESSAGE] = &I2CPSession::GetDateMessageHandler; | |
blob - /dev/null | |
blob + e95bc9ce83df2f9438c88aec9d39e2c3ea56e0eb (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_I2CP_h | |
@@ -0,0 +1,24 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/I2CP.h | |
+--- libi2pd_client/I2CP.h.orig | |
++++ libi2pd_client/I2CP.h | |
+@@ -81,7 +81,7 @@ namespace client | |
+ { | |
+ 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, | |
+ const std::map<std::string, std::string>& params); | |
+ ~I2CPDestination () {}; | |
+@@ -227,7 +227,7 @@ namespace client | |
+ | |
+ void Start (); | |
+ void Stop (); | |
+- boost::asio::io_service& GetService () { return GetIOService (); }; | |
++ boost::asio::io_context& GetService () { return GetIOService (); }; | |
+ bool IsSingleThread () const { return m_IsSingleThread; }; | |
+ | |
+ bool InsertSession (std::shared_ptr<I2CPSession> session); | |
blob - /dev/null | |
blob + 7535fe831e5977ddbf607de024384fe3ed902d40 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_I2PService_h | |
@@ -0,0 +1,24 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/I2PService.h | |
+--- libi2pd_client/I2PService.h.orig | |
++++ libi2pd_client/I2PService.h | |
+@@ -61,7 +61,7 @@ namespace client | |
+ } | |
+ 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); | |
+- inline boost::asio::io_service& GetService () { return m_LocalDestination->GetService (); } | |
++ inline boost::asio::io_context& GetService () { return m_LocalDestination->GetService (); } | |
+ | |
+ virtual void Start () = 0; | |
+ virtual void Stop () = 0; | |
+@@ -283,7 +283,7 @@ namespace client | |
+ public: | |
+ | |
+ TCPIPAcceptor (const std::string& address, uint16_t port, std::shared_ptr<ClientDestination> localDestination = nullptr) : | |
+- ServiceAcceptor (boost::asio::ip::tcp::endpoint (boost::asio::ip::address::from_string(address), port), localDestination) {} | |
++ ServiceAcceptor (boost::asio::ip::tcp::endpoint (boost::asio::ip::make_address(address), port), localDestination) {} | |
+ }; | |
+ } | |
+ } | |
blob - /dev/null | |
blob + e790d3ac49575fcdb04a0146210f54ea9ca6e472 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_I2PTunnel_cpp | |
@@ -0,0 +1,51 @@ | |
+Index: libi2pd_client/I2PTunnel.cpp | |
+--- libi2pd_client/I2PTunnel.cpp.orig | |
++++ libi2pd_client/I2PTunnel.cpp | |
+@@ -717,7 +717,7 @@ namespace client | |
+ { | |
+ m_Endpoint.port (m_Port); | |
+ boost::system::error_code ec; | |
+- auto addr = boost::asio::ip::address::from_string (m_Address, ec); | |
++ auto addr = boost::asio::ip::make_address (m_Address, ec); | |
+ if (!ec) | |
+ { | |
+ m_Endpoint.address (addr); | |
+@@ -726,7 +726,7 @@ namespace client | |
+ else | |
+ { | |
+ auto resolver = std::make_shared<boost::asio::ip::tcp::resolver>(GetService ()); | |
+- resolver->async_resolve (boost::asio::ip::tcp::resolver::query (m_Address, ""), | |
++ resolver->async_resolve (m_Address, "", | |
+ std::bind (&I2PServerTunnel::HandleResolve, this, | |
+ std::placeholders::_1, std::placeholders::_2, resolver)); | |
+ } | |
+@@ -743,17 +743,17 @@ namespace client | |
+ ClearHandlers (); | |
+ } | |
+ | |
+- void I2PServerTunnel::HandleResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it, | |
++ void I2PServerTunnel::HandleResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::results_type results, | |
+ std::shared_ptr<boost::asio::ip::tcp::resolver> resolver) | |
+ { | |
++ auto it = results.cbegin(); | |
+ if (!ecode) | |
+ { | |
+ bool found = false; | |
+ boost::asio::ip::tcp::endpoint ep; | |
+ if (m_LocalAddress) | |
+ { | |
+- boost::asio::ip::tcp::resolver::iterator end; | |
+- while (it != end) | |
++ while (it != results.cend()) | |
+ { | |
+ ep = *it; | |
+ if (!ep.address ().is_unspecified ()) | |
+@@ -806,7 +806,7 @@ namespace client | |
+ void I2PServerTunnel::SetLocalAddress (const std::string& localAddress) | |
+ { | |
+ boost::system::error_code ec; | |
+- auto addr = boost::asio::ip::address::from_string(localAddress, ec); | |
++ auto addr = boost::asio::ip::make_address(localAddress, ec); | |
+ if (!ec) | |
+ m_LocalAddress.reset (new boost::asio::ip::address (addr)); | |
+ else | |
blob - /dev/null | |
blob + 004793a6793fb39855bbb1108aec53b43923359b (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_I2PTunnel_h | |
@@ -0,0 +1,12 @@ | |
+Index: libi2pd_client/I2PTunnel.h | |
+--- libi2pd_client/I2PTunnel.h.orig | |
++++ libi2pd_client/I2PTunnel.h | |
+@@ -208,7 +208,7 @@ namespace client | |
+ | |
+ private: | |
+ | |
+- void HandleResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::iterator it, | |
++ void HandleResolve (const boost::system::error_code& ecode, boost::asio::ip::tcp::resolver::results_type results, | |
+ std::shared_ptr<boost::asio::ip::tcp::resolver> resolver); | |
+ | |
+ void Accept (); | |
blob - /dev/null | |
blob + 6079f2076a493afef3f195fbec870d8b219398d3 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_SAM_cpp | |
@@ -0,0 +1,69 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/SAM.cpp | |
+--- libi2pd_client/SAM.cpp.orig | |
++++ libi2pd_client/SAM.cpp | |
+@@ -371,7 +371,7 @@ namespace client | |
+ // udp forward selected | |
+ boost::system::error_code e; | |
+ // TODO: support hostnames in udp forward | |
+- auto addr = boost::asio::ip::address::from_string(params[SAM_PARAM_HOST], e); | |
++ auto addr = boost::asio::ip::make_address(params[SAM_PARAM_HOST], e); | |
+ if (e) | |
+ { | |
+ // not an ip address | |
+@@ -624,7 +624,7 @@ namespace client | |
+ auto socket = session->acceptQueue.front ().first; | |
+ session->acceptQueue.pop_front (); | |
+ if (socket) | |
+- m_Owner.GetService ().post (std::bind(&SAMSocket::TerminateClose, socket)); | |
++ boost::asio::post (m_Owner.GetService (), std::bind(&SAMSocket::TerminateClose, socket)); | |
+ } | |
+ if (session->acceptQueue.size () < SAM_SESSION_MAX_ACCEPT_QUEUE_SIZE) | |
+ { | |
+@@ -1046,13 +1046,13 @@ namespace client | |
+ else | |
+ { | |
+ auto s = shared_from_this (); | |
+- m_Owner.GetService ().post ([s] { s->Terminate ("stream read error"); }); | |
++ boost::asio::post (m_Owner.GetService (), [s] { s->Terminate ("stream read error"); }); | |
+ } | |
+ } | |
+ else | |
+ { | |
+ auto s = shared_from_this (); | |
+- m_Owner.GetService ().post ([s] { s->Terminate ("stream read error (op aborted)"); }); | |
++ boost::asio::post (m_Owner.GetService (), [s] { s->Terminate ("stream read error (op aborted)"); }); | |
+ } | |
+ } | |
+ else | |
+@@ -1102,7 +1102,7 @@ namespace client | |
+ auto socket = session->acceptQueue.front ().first; | |
+ session->acceptQueue.pop_front (); | |
+ if (socket) | |
+- m_Owner.GetService ().post (std::bind(&SAMSocket::TerminateClose, socket)); | |
++ boost::asio::post (m_Owner.GetService (), std::bind(&SAMSocket::TerminateClose, socket)); | |
+ } | |
+ if (!session->acceptQueue.empty ()) | |
+ { | |
+@@ -1236,7 +1236,7 @@ namespace client | |
+ | |
+ void SAMSocket::HandleStreamSend(const boost::system::error_code & ec) | |
+ { | |
+- m_Owner.GetService ().post (std::bind( !ec ? &SAMSocket::Receive : &SAMSocket::TerminateClose, shared_from_this())); | |
++ boost::asio::post (m_Owner.GetService (), std::bind( !ec ? &SAMSocket::Receive : &SAMSocket::TerminateClose, shared_from_this())); | |
+ } | |
+ | |
+ SAMSession::SAMSession (SAMBridge & parent, const std::string & id, SAMSessionType type): | |
+@@ -1310,8 +1310,8 @@ namespace client | |
+ | |
+ SAMBridge::SAMBridge (const std::string& address, uint16_t portTCP, uint16_t portUDP, bool singleThread): | |
+ RunnableService ("SAM"), m_IsSingleThread (singleThread), | |
+- m_Acceptor (GetIOService (), boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(address), portTCP)), | |
+- m_DatagramEndpoint (boost::asio::ip::address::from_string(address), (!portUDP) ? portTCP-1 : portUDP), m_DatagramSocket (GetIOService (), m_DatagramEndpoint), | |
++ m_Acceptor (GetIOService (), boost::asio::ip::tcp::endpoint(boost::asio::ip::make_address(address), portTCP)), | |
++ m_DatagramEndpoint (boost::asio::ip::make_address(address), (!portUDP) ? portTCP-1 : portUDP), m_DatagramSocket (GetIOService (), m_DatagramEndpoint), | |
+ m_SignatureTypes | |
+ { | |
+ {"DSA_SHA1", i2p::data::SIGNING_KEY_TYPE_DSA_SHA1}, | |
blob - /dev/null | |
blob + 80e42b6562b6c153c025ad1852a3951e85c18d4f (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_SAM_h | |
@@ -0,0 +1,15 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd_client/SAM.h | |
+--- libi2pd_client/SAM.h.orig | |
++++ libi2pd_client/SAM.h | |
+@@ -246,7 +246,7 @@ namespace client | |
+ void Start (); | |
+ void Stop (); | |
+ | |
+- boost::asio::io_service& GetService () { return GetIOService (); }; | |
++ boost::asio::io_context& GetService () { return GetIOService (); }; | |
+ 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); | |
+ bool AddSession (std::shared_ptr<SAMSession> session); | |
blob - /dev/null | |
blob + a826c254735af8d32405c3c4aa1f394055e520fd (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_client_SOCKS_cpp | |
@@ -0,0 +1,138 @@ | |
+Index: libi2pd_client/SOCKS.cpp | |
+--- libi2pd_client/SOCKS.cpp.orig | |
++++ libi2pd_client/SOCKS.cpp | |
+@@ -126,9 +126,9 @@ namespace proxy | |
+ void HandleSockRecv(const boost::system::error_code & ecode, std::size_t bytes_transfered); | |
+ void Terminate(); | |
+ void AsyncSockRead(); | |
+- boost::asio::const_buffers_1 GenerateSOCKS5SelectAuth(authMethods method); | |
+- boost::asio::const_buffers_1 GenerateSOCKS4Response(errTypes error, uint32_t ip, uint16_t port); | |
+- boost::asio::const_buffers_1 GenerateSOCKS5Response(errTypes error, addrTypes type, const address &addr, uint16_t port); | |
++ boost::asio::const_buffer GenerateSOCKS5SelectAuth(authMethods method); | |
++ boost::asio::const_buffer GenerateSOCKS4Response(errTypes error, uint32_t ip, uint16_t port); | |
++ boost::asio::const_buffer GenerateSOCKS5Response(errTypes error, addrTypes type, const address &addr, uint16_t port); | |
+ bool Socks5ChooseAuth(); | |
+ void Socks5UserPasswdResponse (); | |
+ void SocksRequestFailed(errTypes error); | |
+@@ -145,9 +145,9 @@ namespace proxy | |
+ template<typename Socket> | |
+ void SendUpstreamRequest(std::shared_ptr<Socket>& upstreamSock); | |
+ void HandleUpstreamConnected(const boost::system::error_code & ecode, | |
+- boost::asio::ip::tcp::resolver::iterator itr); | |
++ boost::asio::ip::tcp::resolver::results_type::iterator itr); | |
+ void HandleUpstreamResolved(const boost::system::error_code & ecode, | |
+- boost::asio::ip::tcp::resolver::iterator itr); | |
++ boost::asio::ip::tcp::resolver::results_type results); | |
+ | |
+ boost::asio::ip::tcp::resolver m_proxy_resolver; | |
+ uint8_t m_sock_buff[socks_buffer_size]; | |
+@@ -233,17 +233,17 @@ namespace proxy | |
+ Done(shared_from_this()); | |
+ } | |
+ | |
+- boost::asio::const_buffers_1 SOCKSHandler::GenerateSOCKS4Response(SOCKSHandler::errTypes error, uint32_t ip, uint16_t port) | |
++ boost::asio::const_buffer SOCKSHandler::GenerateSOCKS4Response(SOCKSHandler::errTypes error, uint32_t ip, uint16_t port) | |
+ { | |
+ assert(error >= SOCKS4_OK); | |
+ m_response[0] = '\x00'; // version | |
+ m_response[1] = error; // response code | |
+ htobe16buf(m_response + 2, port); // port | |
+ htobe32buf(m_response + 4, ip); // IP | |
+- return boost::asio::const_buffers_1(m_response,8); | |
++ return boost::asio::const_buffer(m_response,8); | |
+ } | |
+ | |
+- boost::asio::const_buffers_1 SOCKSHandler::GenerateSOCKS5Response(SOCKSHandler::errTypes error, SOCKSHandler::addrTypes type, const SOCKSHandler::address &addr, uint16_t port) | |
++ boost::asio::const_buffer SOCKSHandler::GenerateSOCKS5Response(SOCKSHandler::errTypes error, SOCKSHandler::addrTypes type, const SOCKSHandler::address &addr, uint16_t port) | |
+ { | |
+ size_t size = 6; // header + port | |
+ assert(error <= SOCKS5_ADDR_UNSUP); | |
+@@ -280,14 +280,14 @@ namespace proxy | |
+ } | |
+ break; | |
+ } | |
+- return boost::asio::const_buffers_1(m_response, size); | |
++ return boost::asio::const_buffer(m_response, size); | |
+ } | |
+ | |
+ bool SOCKSHandler::Socks5ChooseAuth() | |
+ { | |
+ m_response[0] = '\x05'; // Version | |
+ m_response[1] = m_authchosen; // Response code | |
+- boost::asio::const_buffers_1 response(m_response, 2); | |
++ boost::asio::const_buffer response(m_response, 2); | |
+ if (m_authchosen == AUTH_UNACCEPTABLE) | |
+ { | |
+ LogPrint(eLogWarning, "SOCKS: v5 authentication negotiation failed"); | |
+@@ -307,14 +307,14 @@ namespace proxy | |
+ m_response[0] = 1; // Version of the subnegotiation | |
+ m_response[1] = 0; // Response code | |
+ LogPrint(eLogDebug, "SOCKS: v5 user/password response"); | |
+- boost::asio::async_write(*m_sock, boost::asio::const_buffers_1(m_response, 2), | |
++ boost::asio::async_write(*m_sock, boost::asio::const_buffer(m_response, 2), | |
+ std::bind(&SOCKSHandler::SentSocksResponse, shared_from_this(), std::placeholders::_1)); | |
+ } | |
+ | |
+ /* All hope is lost beyond this point */ | |
+ void SOCKSHandler::SocksRequestFailed(SOCKSHandler::errTypes error) | |
+ { | |
+- boost::asio::const_buffers_1 response(nullptr,0); | |
++ boost::asio::const_buffer response(nullptr,0); | |
+ assert(error != SOCKS4_OK && error != SOCKS5_OK); | |
+ switch (m_socksv) | |
+ { | |
+@@ -334,7 +334,7 @@ namespace proxy | |
+ | |
+ void SOCKSHandler::SocksRequestSuccess() | |
+ { | |
+- boost::asio::const_buffers_1 response(nullptr,0); | |
++ boost::asio::const_buffer response(nullptr,0); | |
+ // TODO: this should depend on things like the command type and callbacks may change | |
+ switch (m_socksv) | |
+ { | |
+@@ -691,8 +691,7 @@ namespace proxy | |
+ if (m_UpstreamProxyPort) // TCP | |
+ { | |
+ EnterState(UPSTREAM_RESOLVE); | |
+- boost::asio::ip::tcp::resolver::query q(m_UpstreamProxyAddress, std::to_string(m_UpstreamProxyPort)); | |
+- m_proxy_resolver.async_resolve(q, std::bind(&SOCKSHandler::HandleUpstreamResolved, shared_from_this(), | |
++ m_proxy_resolver.async_resolve(m_UpstreamProxyAddress, std::to_string(m_UpstreamProxyPort), std::bind(&SOCKSHandler::HandleUpstreamResolved, shared_from_this(), | |
+ std::placeholders::_1, std::placeholders::_2)); | |
+ } | |
+ else if (!m_UpstreamProxyAddress.empty ())// local | |
+@@ -729,7 +728,7 @@ namespace proxy | |
+ void SOCKSHandler::SocksUpstreamSuccess(std::shared_ptr<Socket>& upstreamSock) | |
+ { | |
+ LogPrint(eLogInfo, "SOCKS: Upstream success"); | |
+- boost::asio::const_buffers_1 response(nullptr, 0); | |
++ boost::asio::const_buffer response(nullptr, 0); | |
+ switch (m_socksv) | |
+ { | |
+ case SOCKS4: | |
+@@ -775,7 +774,7 @@ namespace proxy | |
+ LogPrint(eLogError, "SOCKS: No upstream socket to send handshake to"); | |
+ } | |
+ | |
+- void SOCKSHandler::HandleUpstreamConnected(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::iterator itr) | |
++ void SOCKSHandler::HandleUpstreamConnected(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::results_type::iterator itr) | |
+ { | |
+ if (ecode) { | |
+ LogPrint(eLogWarning, "SOCKS: Could not connect to upstream proxy: ", ecode.message()); | |
+@@ -786,7 +785,7 @@ namespace proxy | |
+ SendUpstreamRequest(m_upstreamSock); | |
+ } | |
+ | |
+- void SOCKSHandler::HandleUpstreamResolved(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::iterator itr) | |
++ void SOCKSHandler::HandleUpstreamResolved(const boost::system::error_code & ecode, boost::asio::ip::tcp::resolver::results_type results) | |
+ { | |
+ if (ecode) { | |
+ // error resolving | |
+@@ -798,7 +797,7 @@ namespace proxy | |
+ EnterState(UPSTREAM_CONNECT); | |
+ auto & service = GetOwner()->GetService(); | |
+ m_upstreamSock = std::make_shared<boost::asio::ip::tcp::socket>(service); | |
+- boost::asio::async_connect(*m_upstreamSock, itr, | |
++ boost::asio::async_connect(*m_upstreamSock, results.cbegin(), results.cend(), | |
+ std::bind(&SOCKSHandler::HandleUpstreamConnected, | |
+ shared_from_this(), std::placeholders::_1, std::placeholders::_2)); | |
+ } | |
blob - /dev/null | |
blob + e34958fa3508254222f2b1f7e2b2e55045febe66 (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_util_cpp | |
@@ -0,0 +1,53 @@ | |
+Index: libi2pd/util.cpp | |
+--- libi2pd/util.cpp.orig | |
++++ libi2pd/util.cpp | |
+@@ -123,8 +123,8 @@ const char *inet_ntop_xp(int af, const void *src, char | |
+ #endif | |
+ #endif | |
+ | |
+-#define address_pair_v4(a,b) { boost::asio::ip::address_v4::from_string (a).to_ulong (), boost::asio::ip::address_v4::from_string (b).to_ulong () } | |
+-#define address_pair_v6(a,b) { boost::asio::ip::address_v6::from_string (a).to_bytes (), boost::asio::ip::address_v6::from_string (b).to_bytes () } | |
++#define address_pair_v4(a,b) { boost::asio::ip::make_address_v4 (a).to_uint (), boost::asio::ip::make_address_v4 (b).to_uint () } | |
++#define address_pair_v6(a,b) { boost::asio::ip::make_address_v6 (a).to_bytes (), boost::asio::ip::make_address_v6 (b).to_bytes () } | |
+ | |
+ namespace i2p | |
+ { | |
+@@ -446,9 +446,9 @@ namespace net | |
+ #ifdef _WIN32 | |
+ LogPrint(eLogError, "NetIface: Cannot get address by interface name, not implemented on WIN32"); | |
+ if (ipv6) | |
+- return boost::asio::ip::address::from_string("::1"); | |
++ return boost::asio::ip::make_address("::1"); | |
+ else | |
+- return boost::asio::ip::address::from_string("127.0.0.1"); | |
++ return boost::asio::ip::make_address("127.0.0.1"); | |
+ #else | |
+ int af = (ipv6 ? AF_INET6 : AF_INET); | |
+ ifaddrs *addrs; | |
+@@ -470,7 +470,7 @@ namespace net | |
+ inet_ntop(af, &((sockaddr_in6 *)cur->ifa_addr)->sin6_addr, addr, INET6_ADDRSTRLEN); | |
+ freeifaddrs(addrs); | |
+ std::string cur_ifaddr(addr); | |
+- return boost::asio::ip::address::from_string(cur_ifaddr); | |
++ return boost::asio::ip::make_address(cur_ifaddr); | |
+ } | |
+ } | |
+ } | |
+@@ -490,7 +490,7 @@ namespace net | |
+ fallback = "127.0.0.1"; | |
+ LogPrint(eLogWarning, "NetIface: Cannot find IPv4 address for interface ", ifname); | |
+ } | |
+- return boost::asio::ip::address::from_string(fallback); | |
++ return boost::asio::ip::make_address(fallback); | |
+ #endif | |
+ } | |
+ | |
+@@ -656,7 +656,7 @@ namespace net | |
+ address_pair_v4("224.0.0.0", "255.255.255.255") | |
+ }; | |
+ | |
+- uint32_t ipv4_address = host.to_v4 ().to_ulong (); | |
++ uint32_t ipv4_address = host.to_v4 ().to_uint (); | |
+ for (const auto& it : reservedIPv4Ranges) { | |
+ if (ipv4_address >= it.first && ipv4_address <= it.second) | |
+ return true; | |
blob - /dev/null | |
blob + 4862d8a647659b6981025d3c047e770dac68b0fc (mode 644) | |
--- /dev/null | |
+++ net/i2pd/patches/patch-libi2pd_util_h | |
@@ -0,0 +1,38 @@ | |
+Deal with removal of types boost::asio::io_service{,::work}, methods | |
+boost::asio::{io_context::post,buffer_cast}. | |
+ | |
+Index: libi2pd/util.h | |
+--- libi2pd/util.h.orig | |
++++ libi2pd/util.h | |
+@@ -177,7 +177,7 @@ namespace util | |
+ RunnableService (const std::string& name): m_Name (name), m_IsRunning (false) {} | |
+ virtual ~RunnableService () {} | |
+ | |
+- boost::asio::io_service& GetIOService () { return m_Service; } | |
++ boost::asio::io_context& GetIOService () { return m_Service; } | |
+ bool IsRunning () const { return m_IsRunning; }; | |
+ | |
+ void StartIOService (); | |
+@@ -192,7 +192,7 @@ namespace util | |
+ std::string m_Name; | |
+ volatile bool m_IsRunning; | |
+ std::unique_ptr<std::thread> m_Thread; | |
+- boost::asio::io_service m_Service; | |
++ boost::asio::io_context m_Service; | |
+ }; | |
+ | |
+ class RunnableServiceWithWork: public RunnableService | |
+@@ -200,11 +200,11 @@ namespace util | |
+ protected: | |
+ | |
+ RunnableServiceWithWork (const std::string& name): | |
+- RunnableService (name), m_Work (GetIOService ()) {} | |
++ RunnableService (name), m_Work (boost::asio::make_work_guard (GetIOService ())) {} | |
+ | |
+ private: | |
+ | |
+- boost::asio::io_service::work m_Work; | |
++ boost::asio::executor_work_guard<boost::asio::io_context::executor_type> m_Work; | |
+ }; | |
+ | |
+ void SetThreadName (const char *name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment