mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-03-30 17:16:05 +00:00
close I2P stream if socket got closed right after connect
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user