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

Method SocksProxySuccess

libi2pd_client/HTTPProxy.cpp:694–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

692 }
693
694 void HTTPReqHandler::SocksProxySuccess()
695 {
696 if(m_ClientRequest.method == "CONNECT") {
697 m_ClientResponse.code = 200;
698 m_send_buf = m_ClientResponse.to_string();
699 boost::asio::async_write(*m_sock, boost::asio::buffer(m_send_buf), boost::asio::transfer_all(), [&] (const boost::system::error_code & ec, std::size_t transferred)
700 {
701 if(ec) GenericProxyError(tr("SOCKS proxy error"), ec.message());
702 else HandoverToUpstreamProxy();
703 });
704 } else {
705 m_send_buf = m_ClientRequestBuffer.str();
706 LogPrint(eLogDebug, "HTTPProxy: Send ", m_send_buf.size(), " bytes");
707 boost::asio::async_write(*m_proxysock, boost::asio::buffer(m_send_buf), boost::asio::transfer_all(), [&](const boost::system::error_code & ec, std::size_t transferred)
708 {
709 if(ec) GenericProxyError(tr("Failed to send request to upstream"), ec.message());
710 else HandoverToUpstreamProxy();
711 });
712 }
713 }
714
715 void HTTPReqHandler::HandleUpstreamHTTPProxyConnect(const boost::system::error_code & ec)
716 {

Callers 1

Calls 3

trFunction · 0.85
LogPrintFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected