1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 08:14:15 +00:00

close client socket if I2P gets closed

This commit is contained in:
orignal 2014-08-17 19:14:40 -04:00
parent dda80703d2
commit fbe6c22884

View File

@ -30,6 +30,7 @@ namespace stream
void I2PTunnelConnection::Terminate () void I2PTunnelConnection::Terminate ()
{ {
m_Socket->close ();
// TODO: remove from I2PTunnel // TODO: remove from I2PTunnel
} }
@ -58,7 +59,14 @@ namespace stream
void I2PTunnelConnection::HandleWrite (const boost::system::error_code& ecode) void I2PTunnelConnection::HandleWrite (const boost::system::error_code& ecode)
{ {
StreamReceive (); if (ecode)
{
LogPrint ("I2PTunnel write error: ", ecode.message ());
m_Stream->Close ();
Terminate ();
}
else
StreamReceive ();
} }
void I2PTunnelConnection::StreamReceive () void I2PTunnelConnection::StreamReceive ()