| 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): |
nothing calls this directly
no test coverage detected