|
|
|
@ -236,7 +236,19 @@ namespace transport
@@ -236,7 +236,19 @@ namespace transport
|
|
|
|
|
void SSU2Server::HandleReceivedFrom (const boost::system::error_code& ecode, size_t bytes_transferred, |
|
|
|
|
Packet * packet, boost::asio::ip::udp::socket& socket) |
|
|
|
|
{ |
|
|
|
|
if (!ecode) |
|
|
|
|
if (!ecode |
|
|
|
|
|| ecode == boost::asio::error::connection_refused |
|
|
|
|
|| ecode == boost::asio::error::connection_reset |
|
|
|
|
|| ecode == boost::asio::error::network_unreachable |
|
|
|
|
|| ecode == boost::asio::error::host_unreachable |
|
|
|
|
#ifdef _WIN32 // windows can throw WinAPI error, which is not handled by ASIO
|
|
|
|
|
|| ecode.value() == boost::winapi::ERROR_CONNECTION_REFUSED_ |
|
|
|
|
|| ecode.value() == boost::winapi::ERROR_NETWORK_UNREACHABLE_ |
|
|
|
|
|| ecode.value() == boost::winapi::ERROR_HOST_UNREACHABLE_ |
|
|
|
|
#endif |
|
|
|
|
) |
|
|
|
|
// just try continue reading when received ICMP response otherwise socket can crash,
|
|
|
|
|
// but better to find out which host were sent it and mark that router as unreachable
|
|
|
|
|
{ |
|
|
|
|
i2p::transport::transports.UpdateReceivedBytes (bytes_transferred); |
|
|
|
|
packet->len = bytes_transferred; |
|
|
|
|