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

Method HandleStreamRequestComplete

libi2pd_client/HTTPProxy.cpp:749–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

747 }
748
749 void HTTPReqHandler::HandleStreamRequestComplete (std::shared_ptr<i2p::stream::Stream> stream)
750 {
751 if (!stream) {
752 LogPrint (eLogError, "HTTPProxy: Error when creating the stream, check the previous warnings for more info");
753 GenericProxyError(tr("Host is down"), tr("Can't create connection to requested host, it may be down. Please try again later."));
754 return;
755 }
756 if (Kill())
757 return;
758 LogPrint (eLogDebug, "HTTPProxy: Created new I2PTunnel stream, sSID=", stream->GetSendStreamID(), ", rSID=", stream->GetRecvStreamID());
759 auto connection = std::make_shared<i2p::client::I2PClientTunnelConnectionHTTP>(GetOwner(), m_sock, stream);
760 GetOwner()->AddHandler (connection);
761 connection->I2PConnect (reinterpret_cast<const uint8_t*>(m_send_buf.data()), m_send_buf.length());
762 Done (shared_from_this());
763 }
764
765 HTTPProxy::HTTPProxy(const std::string& name, const std::string& address, uint16_t port,
766 const std::string & outproxy, bool addresshelper, bool senduseragent, std::shared_ptr<i2p::client::ClientDestination> localDestination):

Callers

nothing calls this directly

Calls 6

LogPrintFunction · 0.85
trFunction · 0.85
GetRecvStreamIDMethod · 0.80
AddHandlerMethod · 0.80
I2PConnectMethod · 0.80
GetSendStreamIDMethod · 0.45

Tested by

no test coverage detected