close I2P stream if socket got closed right after connect

This commit is contained in:
orignal
2026-03-06 13:50:16 -05:00
parent 08ea68a310
commit 0ed8b473f2
2 changed files with 49 additions and 36 deletions

View File

@@ -669,13 +669,18 @@ namespace proxy
{
if(stream)
{
m_ClientResponse.code = 200;
m_ClientResponse.status = "OK";
m_send_buf = m_ClientResponse.to_string();
m_sock->send(boost::asio::buffer(m_send_buf));
auto connection = std::make_shared<i2p::client::I2PTunnelConnection>(GetOwner(), m_sock, stream);
GetOwner()->AddHandler(connection);
connection->I2PConnect();
if (m_sock && m_sock->is_open ())
{
m_ClientResponse.code = 200;
m_ClientResponse.status = "OK";
m_send_buf = m_ClientResponse.to_string();
m_sock->send(boost::asio::buffer(m_send_buf));
auto connection = std::make_shared<i2p::client::I2PTunnelConnection>(GetOwner(), m_sock, stream);
GetOwner()->AddHandler(connection);
connection->I2PConnect();
}
else
stream->AsyncClose ();
m_sock = nullptr;
Terminate();
}