MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / SentSocksDone

Method SentSocksDone

libi2pd_client/SOCKS.cpp:686–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684 }
685
686 void SOCKSHandler::SentSocksDone(const boost::system::error_code & ecode)
687 {
688 if (!ecode)
689 {
690 if (m_cmd == CMD_CONNECT)
691 {
692 if (Kill()) return;
693 if (m_sock && m_sock->is_open ())
694 {
695 LogPrint (eLogInfo, "SOCKS: New I2PTunnel connection");
696 auto connection = std::make_shared<i2p::client::I2PTunnelConnection>(GetOwner(), m_sock, m_stream);
697 GetOwner()->AddHandler (connection);
698 connection->I2PConnect (m_remaining_data,m_remaining_data_len);
699 Done(shared_from_this());
700 }
701 else
702 Terminate ();
703 }
704 else if (m_cmd == CMD_UDP && m_UDPTunnel)
705 {
706 LogPrint (eLogInfo, "SOCKS: Start UDP tunnel");
707 m_UDPTunnel->Start ();
708 AsyncSockRead (); // associate socket
709 }
710 }
711 else
712 {
713 LogPrint (eLogError, "SOCKS: Closing socket after completion reply because: ", ecode.message ());
714 Terminate();
715 }
716 }
717
718 void SOCKSHandler::SentSocksResponse(const boost::system::error_code & ecode)
719 {

Callers

nothing calls this directly

Calls 4

LogPrintFunction · 0.85
AddHandlerMethod · 0.80
I2PConnectMethod · 0.80
StartMethod · 0.45

Tested by

no test coverage detected