mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
catch error 10045 on stopping SAM acceptor (#1233), fix warning in util
This commit is contained in:
parent
a14d554947
commit
f5f4190803
|
@ -203,7 +203,9 @@ namespace net
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (IsWindowsXPorLater())
|
if (IsWindowsXPorLater())
|
||||||
|
{
|
||||||
#define inet_pton inet_pton_xp
|
#define inet_pton inet_pton_xp
|
||||||
|
}
|
||||||
|
|
||||||
if(localAddress.is_v4())
|
if(localAddress.is_v4())
|
||||||
{
|
{
|
||||||
|
@ -220,7 +222,6 @@ namespace net
|
||||||
LogPrint(eLogError, "NetIface: GetMTU(): address family is not supported");
|
LogPrint(eLogError, "NetIface: GetMTU(): address family is not supported");
|
||||||
return fallback;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#else // assume unix
|
#else // assume unix
|
||||||
int GetMTUUnix(const boost::asio::ip::address& localAddress, int fallback)
|
int GetMTUUnix(const boost::asio::ip::address& localAddress, int fallback)
|
||||||
|
|
|
@ -963,7 +963,16 @@ namespace client
|
||||||
void SAMBridge::Stop ()
|
void SAMBridge::Stop ()
|
||||||
{
|
{
|
||||||
m_IsRunning = false;
|
m_IsRunning = false;
|
||||||
m_Acceptor.cancel ();
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
m_Acceptor.cancel ();
|
||||||
|
}
|
||||||
|
catch (const std::exception& ex)
|
||||||
|
{
|
||||||
|
LogPrint (eLogError, "SAM: runtime exception: ", ex.what ());
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& it: m_Sessions)
|
for (auto& it: m_Sessions)
|
||||||
it.second->CloseStreams ();
|
it.second->CloseStreams ();
|
||||||
m_Sessions.clear ();
|
m_Sessions.clear ();
|
||||||
|
|
Loading…
Reference in a new issue