From c0f8ea13e49ffa4b0582596dd5cd05661d2a9f51 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 27 Oct 2003 16:06:00 +0000 Subject: [PATCH] *** empty log message *** --- include/libtorrent/session.hpp | 6 ++++++ src/policy.cpp | 8 ++++++-- src/session.cpp | 6 ++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index 7ee890ef3..6ce3ec054 100755 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -173,6 +173,12 @@ namespace libtorrent { m_ses->run(m_listen_port); } + catch(std::exception& e) + { + std::cerr << typeid(e).name() << "\n"; + std::cerr << e.what() << "\n"; + assert(false); + } catch(...) { assert(false); diff --git a/src/policy.cpp b/src/policy.cpp index fe3789a31..0b8f36dbd 100755 --- a/src/policy.cpp +++ b/src/policy.cpp @@ -115,8 +115,12 @@ namespace libtorrent void policy::peer_from_tracker(const address& remote, const peer_id& id) { - m_torrent->connect_to_peer(remote, id); - m_num_peers++; + try + { + m_torrent->connect_to_peer(remote, id); + m_num_peers++; + } + catch(network_error&) {} } // this is called when we are choked by a peer diff --git a/src/session.cpp b/src/session.cpp index af5ce78dc..0a8e1422f 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -254,7 +254,8 @@ namespace libtorrent // ************************ // let the writable clients send data - for (std::vector >::iterator i = writable_clients.begin(); + for (std::vector >::iterator i + = writable_clients.begin(); i != writable_clients.end(); ++i) { @@ -313,7 +314,8 @@ namespace libtorrent // loop over all clients and purge the ones that has timed out // and check if they have pending data to be sent - for (connection_map::iterator i = m_connections.begin(); i != m_connections.end();) + for (connection_map::iterator i = m_connections.begin(); + i != m_connections.end();) { connection_map::iterator j = i; ++i;