From 3c9e6054b562967cb51a3748c2fc50499bf2bbd3 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 17 Jan 2015 09:42:44 -0500 Subject: [PATCH] use shared local destination for proxies --- HTTPProxy.cpp | 5 +++++ HTTPProxy.h | 2 +- SOCKS.cpp | 5 +++++ SOCKS.h | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/HTTPProxy.cpp b/HTTPProxy.cpp index 5659a80b..cadbe768 100644 --- a/HTTPProxy.cpp +++ b/HTTPProxy.cpp @@ -231,6 +231,11 @@ namespace proxy } } + HTTPProxyServer::HTTPProxyServer(int port): + TCPIPAcceptor(port, i2p::client::context.GetSharedLocalDestination ()) + { + } + std::shared_ptr HTTPProxyServer::CreateHandler(boost::asio::ip::tcp::socket * socket) { return std::make_shared (this, socket); diff --git a/HTTPProxy.h b/HTTPProxy.h index a7b81553..5c226926 100644 --- a/HTTPProxy.h +++ b/HTTPProxy.h @@ -19,7 +19,7 @@ namespace proxy const char* GetName() { return "HTTP Proxy"; } public: - HTTPProxyServer(int port) : TCPIPAcceptor(port, i2p::data::SIGNING_KEY_TYPE_DSA_SHA1) {} + HTTPProxyServer(int port); ~HTTPProxyServer() {} }; diff --git a/SOCKS.cpp b/SOCKS.cpp index ac30b6bd..9db8ee69 100644 --- a/SOCKS.cpp +++ b/SOCKS.cpp @@ -514,6 +514,11 @@ namespace proxy } } + SOCKSServer::SOCKSServer(int port) : + TCPIPAcceptor (port, i2p::client::context.GetSharedLocalDestination ()) + { + } + std::shared_ptr SOCKSServer::CreateHandler(boost::asio::ip::tcp::socket * socket) { return std::make_shared (this, socket); diff --git a/SOCKS.h b/SOCKS.h index 3d107f1c..c946e2a2 100644 --- a/SOCKS.h +++ b/SOCKS.h @@ -19,7 +19,7 @@ namespace proxy const char* GetName() { return "SOCKS"; } public: - SOCKSServer(int port) : TCPIPAcceptor(port) {} + SOCKSServer(int port); ~SOCKSServer() {} };