From f1c9188d555fc8d1df05cfce4943c9f75b5aecc3 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sat, 17 Jun 2006 23:46:00 +0000 Subject: [PATCH] * Compare the block data downloaded by a non-leader with the current and mark the block transfer if they do not match. * Erase handshakes in DownloadMain::stop() rather than Manager::cleanup_download(). This was causing exceptions in PeerList. * Add 1000ns to the timeout when polling to avoid rounding errors messing up scheduling. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@724 e378c898-3ddf-0310-93e7-cc216c733640 --- src/core/poll_manager_epoll.cc | 4 ++-- src/core/poll_manager_select.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/poll_manager_epoll.cc b/src/core/poll_manager_epoll.cc index 3dbc7a32..9d45d1a5 100644 --- a/src/core/poll_manager_epoll.cc +++ b/src/core/poll_manager_epoll.cc @@ -65,7 +65,7 @@ PollManagerEPoll::poll(rak::timer timeout) { // Add 1ms to ensure we don't idle loop due to the lack of // resolution. torrent::perform(); - timeout = std::min(timeout, rak::timer(torrent::next_timeout())); + timeout = std::min(timeout, rak::timer(torrent::next_timeout())) + 1000; if (m_httpStack.is_busy()) { // When we're using libcurl we need to use select, but as this is @@ -82,7 +82,7 @@ PollManagerEPoll::poll(rak::timer timeout) { FD_SET(static_cast(m_poll)->file_descriptor(), m_readSet); unsigned int maxFd = std::max((unsigned int)static_cast(m_poll)->file_descriptor(), - m_httpStack.fdset(m_readSet, m_writeSet, m_errorSet)); + m_httpStack.fdset(m_readSet, m_writeSet, m_errorSet)); timeval t = timeout.tval(); diff --git a/src/core/poll_manager_select.cc b/src/core/poll_manager_select.cc index c8096144..bf98def8 100644 --- a/src/core/poll_manager_select.cc +++ b/src/core/poll_manager_select.cc @@ -63,7 +63,7 @@ PollManagerSelect::~PollManagerSelect() { void PollManagerSelect::poll(rak::timer timeout) { torrent::perform(); - timeout = std::min(timeout, rak::timer(torrent::next_timeout())); + timeout = std::min(timeout, rak::timer(torrent::next_timeout())) + 1000; #if defined USE_VARIABLE_FDSET std::memset(m_readSet, 0, m_setSize);