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);