|
|
@ -991,6 +991,10 @@ namespace client |
|
|
|
|
|
|
|
|
|
|
|
void I2PUDPClientTunnel::HandleRecvFromLocal(const boost::system::error_code & ec, std::size_t transferred) |
|
|
|
void I2PUDPClientTunnel::HandleRecvFromLocal(const boost::system::error_code & ec, std::size_t transferred) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if(m_cancel_resolve) { |
|
|
|
|
|
|
|
LogPrint(eLogDebug, "UDP Client: Ignoring incomming data: stoppping"); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
if(ec) { |
|
|
|
if(ec) { |
|
|
|
LogPrint(eLogError, "UDP Client: Reading from socket error: ", ec.message(), ". Restarting listener..."); |
|
|
|
LogPrint(eLogError, "UDP Client: Reading from socket error: ", ec.message(), ". Restarting listener..."); |
|
|
|
RecvFromLocal(); // Restart listener and continue work
|
|
|
|
RecvFromLocal(); // Restart listener and continue work
|
|
|
@ -1107,14 +1111,13 @@ namespace client |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto dgram = m_LocalDest->GetDatagramDestination(); |
|
|
|
auto dgram = m_LocalDest->GetDatagramDestination(); |
|
|
|
if (dgram) dgram->ResetReceiver(); |
|
|
|
if (dgram) dgram->ResetReceiver(); |
|
|
|
|
|
|
|
m_cancel_resolve = true; |
|
|
|
|
|
|
|
|
|
|
|
m_Sessions.clear(); |
|
|
|
m_Sessions.clear(); |
|
|
|
|
|
|
|
|
|
|
|
if(m_LocalSocket.is_open()) |
|
|
|
if(m_LocalSocket.is_open()) |
|
|
|
m_LocalSocket.close(); |
|
|
|
m_LocalSocket.close(); |
|
|
|
|
|
|
|
|
|
|
|
m_cancel_resolve = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(m_ResolveThread) |
|
|
|
if(m_ResolveThread) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_ResolveThread->join(); |
|
|
|
m_ResolveThread->join(); |
|
|
|