diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 71c4d6cec..b33bf8452 100755 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2712,6 +2712,7 @@ namespace libtorrent (*m_logger) << time_now_string() << " **ERROR**: " << error.message() << "[in peer_connection::on_receive_data]\n"; #endif + set_failed(); on_receive(error, bytes_transferred); throw std::runtime_error(error.message()); } @@ -2872,6 +2873,7 @@ namespace libtorrent (*m_ses.m_logger) << time_now_string() << " CONNECTION FAILED: " << m_remote.address().to_string() << ": " << e.message() << "\n"; #endif + set_failed(); m_ses.connection_failed(self(), m_remote, e.message().c_str()); return; } @@ -2932,6 +2934,7 @@ namespace libtorrent #ifdef TORRENT_VERBOSE_LOGGING (*m_logger) << "**ERROR**: " << error.message() << " [in peer_connection::on_send_data]\n"; #endif + set_failed(); throw std::runtime_error(error.message()); } if (m_disconnecting) return;