mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
UDP Client: ignore incomming traffic and error when stopping (prevent socket restarting)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
f9d67b28ec
commit
b7e7c6db7b
@ -991,6 +991,10 @@ namespace client
|
||||
|
||||
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) {
|
||||
LogPrint(eLogError, "UDP Client: Reading from socket error: ", ec.message(), ". Restarting listener...");
|
||||
RecvFromLocal(); // Restart listener and continue work
|
||||
@ -1107,14 +1111,13 @@ namespace client
|
||||
{
|
||||
auto dgram = m_LocalDest->GetDatagramDestination();
|
||||
if (dgram) dgram->ResetReceiver();
|
||||
m_cancel_resolve = true;
|
||||
|
||||
m_Sessions.clear();
|
||||
|
||||
if(m_LocalSocket.is_open())
|
||||
m_LocalSocket.close();
|
||||
|
||||
m_cancel_resolve = true;
|
||||
|
||||
if(m_ResolveThread)
|
||||
{
|
||||
m_ResolveThread->join();
|
||||
|
Loading…
x
Reference in New Issue
Block a user