Browse Source

catch error 10045 on stopping SAM acceptor (#1233), fix warning in util

pull/1295/head
R4SAS 6 years ago
parent
commit
f5f4190803
  1. 3
      libi2pd/util.cpp
  2. 9
      libi2pd_client/SAM.cpp

3
libi2pd/util.cpp

@ -203,7 +203,9 @@ namespace net @@ -203,7 +203,9 @@ namespace net
#endif
if (IsWindowsXPorLater())
{
#define inet_pton inet_pton_xp
}
if(localAddress.is_v4())
{
@ -220,7 +222,6 @@ namespace net @@ -220,7 +222,6 @@ namespace net
LogPrint(eLogError, "NetIface: GetMTU(): address family is not supported");
return fallback;
}
}
#else // assume unix
int GetMTUUnix(const boost::asio::ip::address& localAddress, int fallback)

9
libi2pd_client/SAM.cpp

@ -963,7 +963,16 @@ namespace client @@ -963,7 +963,16 @@ namespace client
void SAMBridge::Stop ()
{
m_IsRunning = false;
try
{
m_Acceptor.cancel ();
}
catch (const std::exception& ex)
{
LogPrint (eLogError, "SAM: runtime exception: ", ex.what ());
}
for (auto& it: m_Sessions)
it.second->CloseStreams ();
m_Sessions.clear ();

Loading…
Cancel
Save