mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 20:52:30 +00:00
Task Scheduler, log viewer pops up and disapperes. good good
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@308 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -11,7 +11,7 @@ void
|
||||
Download::set_download(torrent::Download d) {
|
||||
m_download = d;
|
||||
|
||||
m_connTrackerSucceded = m_download.signal_tracker_succeded(sigc::bind(sigc::mem_fun(*this, &Download::receive_tracker_msg), "^_^"));
|
||||
m_connTrackerSucceded = m_download.signal_tracker_succeded(sigc::bind(sigc::mem_fun(*this, &Download::receive_tracker_msg), ""));
|
||||
m_connTrackerFailed = m_download.signal_tracker_failed(sigc::mem_fun(*this, &Download::receive_tracker_msg));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ Log::push_front(const std::string& msg) {
|
||||
|
||||
Log::iterator
|
||||
Log::find_older(utils::Timer t) {
|
||||
return std::find_if(begin(), end(), func::on(func::mem_ptr_ref(&Type::first),
|
||||
std::bind1st(std::less_equal<utils::Timer>(), t)));
|
||||
return std::find_if(begin(), end(),
|
||||
func::on(func::mem_ptr_ref(&Type::first), std::bind2nd(std::less_equal<utils::Timer>(), t)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-8
@@ -13,7 +13,7 @@
|
||||
namespace core {
|
||||
|
||||
void
|
||||
Poll::poll() {
|
||||
Poll::poll(utils::Timer timeout) {
|
||||
FD_ZERO(m_readSet);
|
||||
FD_ZERO(m_writeSet);
|
||||
FD_ZERO(m_exceptSet);
|
||||
@@ -29,15 +29,11 @@ Poll::poll() {
|
||||
m_maxFd = std::max(m_maxFd, n);
|
||||
}
|
||||
|
||||
uint64_t t = torrent::get(torrent::TIME_SELECT);
|
||||
|
||||
if (t > 1000000)
|
||||
t = 1000000;
|
||||
|
||||
timeval timeout = {t / 1000000, t % 1000000};
|
||||
timeout = std::min(timeout, utils::Timer(torrent::get(torrent::TIME_SELECT)));
|
||||
timeval t = timeout.tval();
|
||||
|
||||
errno = 0;
|
||||
m_maxFd = select(m_maxFd + 1, m_readSet, m_writeSet, m_exceptSet, &timeout);
|
||||
m_maxFd = select(m_maxFd + 1, m_readSet, m_writeSet, m_exceptSet, &t);
|
||||
|
||||
if (m_maxFd >= 0) {
|
||||
work();
|
||||
|
||||
+2
-1
@@ -4,6 +4,7 @@
|
||||
#include <sys/select.h>
|
||||
#include <sigc++/slot.h>
|
||||
|
||||
#include "utils/timer.h"
|
||||
#include "curl_stack.h"
|
||||
|
||||
namespace core {
|
||||
@@ -19,7 +20,7 @@ public:
|
||||
Poll() : m_readSet(new fd_set), m_writeSet(new fd_set), m_exceptSet(new fd_set) {}
|
||||
~Poll() { delete m_readSet; delete m_writeSet; delete m_exceptSet; }
|
||||
|
||||
void poll();
|
||||
void poll(utils::Timer t);
|
||||
|
||||
SlotFactory get_http_factory();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user