introduced ClientContext

This commit is contained in:
orignal 2014-10-15 20:52:17 -04:00
parent 18d6a2c70e
commit 89e5b56a19
13 changed files with 234 additions and 221 deletions

View file

@ -2,6 +2,7 @@
#include "Identity.h"
#include "NetDb.h"
#include "Destination.h"
#include "ClientContext.h"
#include <cstring>
#include <stdexcept>
#include <boost/date_time/posix_time/posix_time.hpp>
@ -159,7 +160,7 @@ namespace proxy
LogPrint("--- sock4a find lease set");
m_ls = i2p::data::netdb.FindLeaseSet(m_dest);
if (!m_ls || m_ls->HasNonExpiredLeases()) {
i2p::data::netdb.RequestDestination (m_dest, true, i2p::stream::GetSharedLocalDestination ()->GetTunnelPool ());
i2p::data::netdb.RequestDestination (m_dest, true, i2p::client::GetSharedLocalDestination ()->GetTunnelPool ());
m_ls_timer.expires_from_now(boost::posix_time::seconds(socks_leaseset_timeout));
m_ls_timer.async_wait(boost::bind(&SOCKS4AHandler::LeaseSetTimeout, this, boost::asio::placeholders::error));
} else {
@ -223,7 +224,7 @@ namespace proxy
void SOCKS4AHandler::SentConnectionSuccess(const boost::system::error_code & ecode)
{
LogPrint("--- socks4a making connection");
m_stream = i2p::stream::GetSharedLocalDestination ()->CreateNewOutgoingStream(*m_ls);
m_stream = i2p::client::GetSharedLocalDestination ()->CreateNewOutgoingStream(*m_ls);
m_state = OKAY;
LogPrint("--- socks4a state is ", m_state);
AsyncSockRead();