mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
* HTTPProxy.cpp : unwrap HandleStreamRequestComplete()
This commit is contained in:
parent
4098a5c08e
commit
a9f3235fd3
@ -318,20 +318,18 @@ namespace proxy {
|
|||||||
|
|
||||||
void HTTPReqHandler::HandleStreamRequestComplete (std::shared_ptr<i2p::stream::Stream> stream)
|
void HTTPReqHandler::HandleStreamRequestComplete (std::shared_ptr<i2p::stream::Stream> stream)
|
||||||
{
|
{
|
||||||
if (stream)
|
if (!stream) {
|
||||||
{
|
|
||||||
if (Kill()) return;
|
|
||||||
LogPrint (eLogInfo, "HTTPProxy: New I2PTunnel connection");
|
|
||||||
auto connection = std::make_shared<i2p::client::I2PTunnelConnection>(GetOwner(), m_sock, stream);
|
|
||||||
GetOwner()->AddHandler (connection);
|
|
||||||
connection->I2PConnect (reinterpret_cast<const uint8_t*>(m_request.data()), m_request.size());
|
|
||||||
Done(shared_from_this());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogPrint (eLogError, "HTTPProxy: error when creating the stream, check the previous warnings for more info");
|
LogPrint (eLogError, "HTTPProxy: error when creating the stream, check the previous warnings for more info");
|
||||||
HTTPRequestFailed("error when creating the stream, check logs");
|
HTTPRequestFailed("error when creating the stream, check logs");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
if (Kill())
|
||||||
|
return;
|
||||||
|
LogPrint (eLogDebug, "HTTPProxy: New I2PTunnel connection");
|
||||||
|
auto connection = std::make_shared<i2p::client::I2PTunnelConnection>(GetOwner(), m_sock, stream);
|
||||||
|
GetOwner()->AddHandler (connection);
|
||||||
|
connection->I2PConnect (reinterpret_cast<const uint8_t*>(m_request.data()), m_request.size());
|
||||||
|
Done (shared_from_this());
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPProxy::HTTPProxy(const std::string& address, int port, std::shared_ptr<i2p::client::ClientDestination> localDestination):
|
HTTPProxy::HTTPProxy(const std::string& address, int port, std::shared_ptr<i2p::client::ClientDestination> localDestination):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user