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

Method HandleHTTPConnectStreamRequestComplete

libi2pd_client/HTTPProxy.cpp:669–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667 }
668
669 void HTTPReqHandler::HandleHTTPConnectStreamRequestComplete(std::shared_ptr<i2p::stream::Stream> stream)
670 {
671 if(stream)
672 {
673 if (m_sock && m_sock->is_open ())
674 {
675 m_ClientResponse.code = 200;
676 m_ClientResponse.status = "OK";
677 m_send_buf = m_ClientResponse.to_string();
678 m_sock->send(boost::asio::buffer(m_send_buf));
679 auto connection = std::make_shared<i2p::client::I2PTunnelConnection>(GetOwner(), m_sock, stream);
680 GetOwner()->AddHandler(connection);
681 connection->I2PConnect();
682 }
683 else
684 stream->AsyncClose ();
685 m_sock = nullptr;
686 Terminate();
687 }
688 else
689 {
690 GenericProxyError(tr("CONNECT error"), tr("Failed to connect"));
691 }
692 }
693
694 void HTTPReqHandler::SocksProxySuccess()
695 {

Callers

nothing calls this directly

Calls 5

trFunction · 0.85
to_stringMethod · 0.80
AddHandlerMethod · 0.80
I2PConnectMethod · 0.80
AsyncCloseMethod · 0.80

Tested by

no test coverage detected