From 433b3fd27a8c025e0fa73c0335ac1a58ac40cee2 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 1 Aug 2004 21:08:34 +0000 Subject: [PATCH] *** empty log message *** --- src/session.cpp | 12 +++++++++++- src/torrent.cpp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/session.cpp b/src/session.cpp index 86559727d..f70e3cff9 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -445,7 +445,17 @@ namespace libtorrent { namespace detail if (*i == m_listen_socket) { assert(m_listen_socket); - boost::shared_ptr s = (*i)->accept(); + boost::shared_ptr s; + try + { + s = (*i)->accept(); + } + catch(std::exception& e) + { +#ifndef NDEBUG + (*m_logger) << "accept failed: " << e.what() << "\n"; +#endif + } if (s) { s->set_blocking(false); diff --git a/src/torrent.cpp b/src/torrent.cpp index 3eafe2747..d4bcf5133 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -504,7 +504,7 @@ namespace libtorrent req.url = m_torrent_file.trackers()[m_currently_trying_tracker].url; req.num_want = std::max( (m_policy->get_max_connections() - - m_policy->num_peers()) * 2, 0); + - m_policy->num_peers()), 0); // default initialize, these should be set by caller // before passing the request to the tracker_manager