diff options
author | amdmi3 <amdmi3@FreeBSD.org> | 2017-02-22 17:33:22 +0800 |
---|---|---|
committer | amdmi3 <amdmi3@FreeBSD.org> | 2017-02-22 17:33:22 +0800 |
commit | 9ba6b57e2e5959dfbf6523a3310897dbca53d8c9 (patch) | |
tree | 96cab968e907f18dbbf3021f9ff242cc22319e2f /security/i2pd | |
parent | 51c4459c0a0db68bd266133def5299d2cf01bba7 (diff) | |
download | freebsd-ports-gnome-9ba6b57e2e5959dfbf6523a3310897dbca53d8c9.tar.gz freebsd-ports-gnome-9ba6b57e2e5959dfbf6523a3310897dbca53d8c9.tar.zst freebsd-ports-gnome-9ba6b57e2e5959dfbf6523a3310897dbca53d8c9.zip |
- Update to 2.12.0
Diffstat (limited to 'security/i2pd')
-rw-r--r-- | security/i2pd/Makefile | 3 | ||||
-rw-r--r-- | security/i2pd/distinfo | 6 | ||||
-rw-r--r-- | security/i2pd/files/patch-fix-daemon-option-eating-100-cpu | 204 |
3 files changed, 4 insertions, 209 deletions
diff --git a/security/i2pd/Makefile b/security/i2pd/Makefile index 29df8dafafdd..e68a9c7b9ff6 100644 --- a/security/i2pd/Makefile +++ b/security/i2pd/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= i2pd -PORTVERSION= 2.11.0 -PORTREVISION= 4 +PORTVERSION= 2.12.0 CATEGORIES= security net-p2p MAINTAINER= amdmi3@FreeBSD.org diff --git a/security/i2pd/distinfo b/security/i2pd/distinfo index 7934a95cbca8..5ca7d38b8550 100644 --- a/security/i2pd/distinfo +++ b/security/i2pd/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1482255271 -SHA256 (PurpleI2P-i2pd-2.11.0_GH0.tar.gz) = 4d7946e33a6a1dd4439590ea23b494f36e6fbcb81f7b36857bf264413a19e9db -SIZE (PurpleI2P-i2pd-2.11.0_GH0.tar.gz) = 3091516 +TIMESTAMP = 1487240066 +SHA256 (PurpleI2P-i2pd-2.12.0_GH0.tar.gz) = afb763aea2a4f4b51e327352d5da82ec08e84735d28db9af7710563a117fc648 +SIZE (PurpleI2P-i2pd-2.12.0_GH0.tar.gz) = 3150471 diff --git a/security/i2pd/files/patch-fix-daemon-option-eating-100-cpu b/security/i2pd/files/patch-fix-daemon-option-eating-100-cpu deleted file mode 100644 index c7d53ac822ed..000000000000 --- a/security/i2pd/files/patch-fix-daemon-option-eating-100-cpu +++ /dev/null @@ -1,204 +0,0 @@ -commit 442c63d7a4a447a120400fcb3428bfc2c1ec18cc -Author: orignal <i2porignal@yandex.ru> -Date: Thu Dec 22 13:32:06 2016 -0500 - - #746. initialize io_service after daeminization - -diff --git Transports.cpp Transports.cpp -index 1b9d52a1..b422297f 100644 ---- Transports.cpp -+++ Transports.cpp -@@ -108,8 +108,8 @@ namespace transport - Transports transports; - - Transports::Transports (): -- m_IsOnline (true), m_IsRunning (false), m_Thread (nullptr), m_Work (m_Service), -- m_PeerCleanupTimer (m_Service), m_PeerTestTimer (m_Service), -+ m_IsOnline (true), m_IsRunning (false), m_Thread (nullptr), m_Service (nullptr), -+ m_Work (nullptr), m_PeerCleanupTimer (nullptr), m_PeerTestTimer (nullptr), - m_NTCPServer (nullptr), m_SSUServer (nullptr), m_DHKeysPairSupplier (5), // 5 pre-generated keys - m_TotalSentBytes(0), m_TotalReceivedBytes(0), m_InBandwidth (0), m_OutBandwidth (0), - m_LastInBandwidthUpdateBytes (0), m_LastOutBandwidthUpdateBytes (0), m_LastBandwidthUpdateTime (0) -@@ -119,10 +119,25 @@ namespace transport - Transports::~Transports () - { - Stop (); -+ if (m_Service) -+ { -+ delete m_PeerCleanupTimer; m_PeerCleanupTimer = nullptr; -+ delete m_PeerTestTimer; m_PeerTestTimer = nullptr; -+ delete m_Work; m_Work = nullptr; -+ delete m_Service; m_Service = nullptr; -+ } - } - - void Transports::Start (bool enableNTCP, bool enableSSU) - { -+ if (!m_Service) -+ { -+ m_Service = new boost::asio::io_service (); -+ m_Work = new boost::asio::io_service::work (*m_Service); -+ m_PeerCleanupTimer = new boost::asio::deadline_timer (*m_Service); -+ m_PeerTestTimer = new boost::asio::deadline_timer (*m_Service); -+ } -+ - m_DHKeysPairSupplier.Start (); - m_IsRunning = true; - m_Thread = new std::thread (std::bind (&Transports::Run, this)); -@@ -167,16 +182,16 @@ namespace transport - LogPrint (eLogError, "Transports: SSU server already exists"); - } - } -- m_PeerCleanupTimer.expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); -- m_PeerCleanupTimer.async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); -- m_PeerTestTimer.expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); -- m_PeerTestTimer.async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); -+ m_PeerCleanupTimer->expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); -+ m_PeerCleanupTimer->async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); -+ m_PeerTestTimer->expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); -+ m_PeerTestTimer->async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); - } - - void Transports::Stop () - { -- m_PeerCleanupTimer.cancel (); -- m_PeerTestTimer.cancel (); -+ if (m_PeerCleanupTimer) m_PeerCleanupTimer->cancel (); -+ if (m_PeerTestTimer) m_PeerTestTimer->cancel (); - m_Peers.clear (); - if (m_SSUServer) - { -@@ -193,7 +208,7 @@ namespace transport - - m_DHKeysPairSupplier.Stop (); - m_IsRunning = false; -- m_Service.stop (); -+ if (m_Service) m_Service->stop (); - if (m_Thread) - { - m_Thread->join (); -@@ -204,11 +219,11 @@ namespace transport - - void Transports::Run () - { -- while (m_IsRunning) -+ while (m_IsRunning && m_Service) - { - try - { -- m_Service.run (); -+ m_Service->run (); - } - catch (std::exception& ex) - { -@@ -251,7 +266,7 @@ namespace transport - #ifdef WITH_EVENTS - EmitEvent({{"type" , "transport.sendmsg"}, {"ident", ident.ToBase64()}, {"number", std::to_string(msgs.size())}}); - #endif -- m_Service.post (std::bind (&Transports::PostMessages, this, ident, msgs)); -+ m_Service->post (std::bind (&Transports::PostMessages, this, ident, msgs)); - } - - void Transports::PostMessages (i2p::data::IdentHash ident, std::vector<std::shared_ptr<i2p::I2NPMessage> > msgs) -@@ -386,7 +401,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)); -+ m_Service->post (std::bind (&Transports::HandleRequestComplete, this, r, ident)); - } - - void Transports::HandleRequestComplete (std::shared_ptr<const i2p::data::RouterInfo> r, i2p::data::IdentHash ident) -@@ -411,7 +426,7 @@ namespace transport - - void Transports::NTCPResolve (const std::string& addr, const i2p::data::IdentHash& ident) - { -- auto resolver = std::make_shared<boost::asio::ip::tcp::resolver>(m_Service); -+ auto resolver = std::make_shared<boost::asio::ip::tcp::resolver>(*m_Service); - resolver->async_resolve (boost::asio::ip::tcp::resolver::query (addr, ""), - std::bind (&Transports::HandleNTCPResolve, this, - std::placeholders::_1, std::placeholders::_2, ident, resolver)); -@@ -454,7 +469,7 @@ namespace transport - - void Transports::SSUResolve (const std::string& addr, const i2p::data::IdentHash& ident) - { -- auto resolver = std::make_shared<boost::asio::ip::tcp::resolver>(m_Service); -+ auto resolver = std::make_shared<boost::asio::ip::tcp::resolver>(*m_Service); - resolver->async_resolve (boost::asio::ip::tcp::resolver::query (addr, ""), - std::bind (&Transports::HandleSSUResolve, this, - std::placeholders::_1, std::placeholders::_2, ident, resolver)); -@@ -497,7 +512,7 @@ namespace transport - void Transports::CloseSession (std::shared_ptr<const i2p::data::RouterInfo> router) - { - if (!router) return; -- m_Service.post (std::bind (&Transports::PostCloseSession, this, router)); -+ m_Service->post (std::bind (&Transports::PostCloseSession, this, router)); - } - - void Transports::PostCloseSession (std::shared_ptr<const i2p::data::RouterInfo> router) -@@ -584,7 +599,7 @@ namespace transport - - void Transports::PeerConnected (std::shared_ptr<TransportSession> session) - { -- m_Service.post([session, this]() -+ m_Service->post([session, this]() - { - auto remoteIdentity = session->GetRemoteIdentity (); - if (!remoteIdentity) return; -@@ -632,7 +647,7 @@ namespace transport - - void Transports::PeerDisconnected (std::shared_ptr<TransportSession> session) - { -- m_Service.post([session, this]() -+ m_Service->post([session, this]() - { - auto remoteIdentity = session->GetRemoteIdentity (); - if (!remoteIdentity) return; -@@ -690,8 +705,8 @@ namespace transport - UpdateBandwidth (); // TODO: use separate timer(s) for it - if (i2p::context.GetStatus () == eRouterStatusTesting) // if still testing, repeat peer test - DetectExternalIP (); -- m_PeerCleanupTimer.expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); -- m_PeerCleanupTimer.async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); -+ m_PeerCleanupTimer->expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT)); -+ m_PeerCleanupTimer->async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1)); - } - } - -@@ -700,8 +715,8 @@ namespace transport - if (ecode != boost::asio::error::operation_aborted) - { - PeerTest (); -- m_PeerTestTimer.expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); -- m_PeerTestTimer.async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); -+ m_PeerTestTimer->expires_from_now (boost::posix_time::minutes(PEER_TEST_INTERVAL)); -+ m_PeerTestTimer->async_wait (std::bind (&Transports::HandlePeerTestTimer, this, std::placeholders::_1)); - } - } - -diff --git Transports.h Transports.h -index d83c0370..a68838e2 100644 ---- Transports.h -+++ Transports.h -@@ -84,7 +84,7 @@ namespace transport - bool IsOnline() const { return m_IsOnline; }; - void SetOnline (bool online) { m_IsOnline = online; }; - -- boost::asio::io_service& GetService () { return m_Service; }; -+ boost::asio::io_service& GetService () { return *m_Service; }; - std::shared_ptr<i2p::crypto::DHKeys> GetNextDHKeysPair (); - void ReuseDHKeysPair (std::shared_ptr<i2p::crypto::DHKeys> pair); - -@@ -144,9 +144,9 @@ namespace transport - - bool m_IsOnline, m_IsRunning; - std::thread * m_Thread; -- boost::asio::io_service m_Service; -- boost::asio::io_service::work m_Work; -- boost::asio::deadline_timer m_PeerCleanupTimer, m_PeerTestTimer; -+ boost::asio::io_service * m_Service; -+ boost::asio::io_service::work * m_Work; -+ boost::asio::deadline_timer * m_PeerCleanupTimer, * m_PeerTestTimer; - - NTCPServer * m_NTCPServer; - SSUServer * m_SSUServer; |