mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
Solve weak_ptr issue
This commit is contained in:
parent
0339a4f963
commit
6643b4188a
@ -53,8 +53,9 @@ namespace proxy
|
|||||||
public:
|
public:
|
||||||
HTTPProxyHandler(HTTPProxyServer * parent, boost::asio::ip::tcp::socket * sock) :
|
HTTPProxyHandler(HTTPProxyServer * parent, boost::asio::ip::tcp::socket * sock) :
|
||||||
I2PServiceHandler(parent), m_sock(sock)
|
I2PServiceHandler(parent), m_sock(sock)
|
||||||
{ AsyncSockRead(); EnterState(GET_METHOD); }
|
{ EnterState(GET_METHOD); }
|
||||||
~HTTPProxyHandler() { Terminate(); }
|
~HTTPProxyHandler() { Terminate(); }
|
||||||
|
void Handle () { AsyncSockRead(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
void HTTPProxyHandler::AsyncSockRead()
|
void HTTPProxyHandler::AsyncSockRead()
|
||||||
@ -255,7 +256,9 @@ namespace proxy
|
|||||||
if (!ecode)
|
if (!ecode)
|
||||||
{
|
{
|
||||||
LogPrint(eLogDebug,"--- HTTP Proxy accepted");
|
LogPrint(eLogDebug,"--- HTTP Proxy accepted");
|
||||||
AddHandler(std::make_shared<HTTPProxyHandler> (this, socket));
|
auto handler = std::make_shared<HTTPProxyHandler> (this, socket);
|
||||||
|
AddHandler(handler);
|
||||||
|
handler->Handle();
|
||||||
Accept();
|
Accept();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -128,8 +128,9 @@ namespace proxy
|
|||||||
SOCKSHandler(SOCKSServer * parent, boost::asio::ip::tcp::socket * sock) :
|
SOCKSHandler(SOCKSServer * parent, boost::asio::ip::tcp::socket * sock) :
|
||||||
I2PServiceHandler(parent), m_sock(sock), m_stream(nullptr),
|
I2PServiceHandler(parent), m_sock(sock), m_stream(nullptr),
|
||||||
m_authchosen(AUTH_UNACCEPTABLE), m_addrtype(ADDR_IPV4)
|
m_authchosen(AUTH_UNACCEPTABLE), m_addrtype(ADDR_IPV4)
|
||||||
{ m_address.ip = 0; EnterState(GET_SOCKSV); AsyncSockRead(); }
|
{ m_address.ip = 0; EnterState(GET_SOCKSV); }
|
||||||
~SOCKSHandler() { Terminate(); }
|
~SOCKSHandler() { Terminate(); }
|
||||||
|
void Handle() { AsyncSockRead(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
void SOCKSHandler::AsyncSockRead()
|
void SOCKSHandler::AsyncSockRead()
|
||||||
@ -538,7 +539,9 @@ namespace proxy
|
|||||||
if (!ecode)
|
if (!ecode)
|
||||||
{
|
{
|
||||||
LogPrint(eLogDebug,"--- SOCKS accepted");
|
LogPrint(eLogDebug,"--- SOCKS accepted");
|
||||||
AddHandler(std::make_shared<SOCKSHandler> (this, socket));
|
auto handle = std::make_shared<SOCKSHandler> (this, socket);
|
||||||
|
AddHandler(handle);
|
||||||
|
handle->Handle();
|
||||||
Accept();
|
Accept();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user