Solve weak_ptr issue

This commit is contained in:
Francisco Blas (klondike) Izquierdo Riera 2015-01-07 22:49:28 +01:00
parent 0339a4f963
commit 6643b4188a
2 changed files with 10 additions and 4 deletions

View file

@ -53,8 +53,9 @@ namespace proxy
public:
HTTPProxyHandler(HTTPProxyServer * parent, boost::asio::ip::tcp::socket * sock) :
I2PServiceHandler(parent), m_sock(sock)
{ AsyncSockRead(); EnterState(GET_METHOD); }
{ EnterState(GET_METHOD); }
~HTTPProxyHandler() { Terminate(); }
void Handle () { AsyncSockRead(); }
};
void HTTPProxyHandler::AsyncSockRead()
@ -255,7 +256,9 @@ namespace proxy
if (!ecode)
{
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();
}
else