* Remove stale lock files if it is held by the same hostname and the

pid is not running.

* Added rak::timer::from_seconds(uint32_t) and converted all uses to
this to avoid overflows etc.

* For each cycle through the tracker list without any successfull
connections, increase the timeout by 20 seconds.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@635 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-02-09 19:18:26 +00:00
parent 126bb511b8
commit e5c5f7ecb1
21 changed files with 89 additions and 31 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ WindowDownloadList::~WindowDownloadList() {
void
WindowDownloadList::redraw() {
m_slotSchedule(this, (cachedTime + 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
m_canvas->erase();
+1 -1
View File
@@ -54,7 +54,7 @@ WindowDownloadStatusbar::WindowDownloadStatusbar(core::Download* d) :
void
WindowDownloadStatusbar::redraw() {
m_slotSchedule(this, (cachedTime + 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
m_canvas->erase();
+1 -1
View File
@@ -69,7 +69,7 @@ hack_wstring(const std::string& src) {
void
WindowFileList::redraw() {
m_slotSchedule(this, (cachedTime + 10 * 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(10)).round_seconds());
m_canvas->erase();
if (m_download->get_download().size_file_entries() == 0 ||
+2 -2
View File
@@ -58,7 +58,7 @@ WindowHttpQueue::WindowHttpQueue(core::HttpQueue* q) :
void
WindowHttpQueue::redraw() {
m_slotSchedule(this, (cachedTime + 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
cleanup_list();
@@ -147,7 +147,7 @@ WindowHttpQueue::receive_erase(core::CurlGet* h) {
throw std::logic_error("WindowHttpQueue::receive_erase(...) tried to remove an object we don't have");
itr->m_http = NULL;
itr->m_timer = cachedTime + 10000000;
itr->m_timer = cachedTime + rak::timer::from_seconds(1);
mark_dirty();
}
+1 -1
View File
@@ -60,7 +60,7 @@ WindowLog::~WindowLog() {
WindowLog::iterator
WindowLog::find_older() {
return m_log->find_older(cachedTime - 60*1000000);
return m_log->find_older(cachedTime - rak::timer::from_seconds(60));
}
void
+1 -1
View File
@@ -58,7 +58,7 @@ WindowLogComplete::~WindowLogComplete() {
WindowLogComplete::iterator
WindowLogComplete::find_older() {
return m_log->find_older(cachedTime - 60*1000000);
return m_log->find_older(cachedTime - rak::timer::from_seconds(60));
}
void
+1 -1
View File
@@ -57,7 +57,7 @@ WindowPeerInfo::WindowPeerInfo(core::Download* d, PList* l, PList::iterator* f)
void
WindowPeerInfo::redraw() {
m_slotSchedule(this, (cachedTime + 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
m_canvas->erase();
int y = 0;
+1 -1
View File
@@ -56,7 +56,7 @@ WindowPeerList::WindowPeerList(core::Download* d, PList* l, PList::iterator* f)
void
WindowPeerList::redraw() {
m_slotSchedule(this, (cachedTime + 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
m_canvas->erase();
int x = 2;
+1 -1
View File
@@ -54,7 +54,7 @@ WindowStatusbar::WindowStatusbar(Control* c) :
void
WindowStatusbar::redraw() {
m_slotSchedule(this, (cachedTime + 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
m_canvas->erase();
+1 -1
View File
@@ -48,7 +48,7 @@ WindowTitle::WindowTitle(const std::string& s) :
void
WindowTitle::redraw() {
m_slotSchedule(this, (cachedTime + 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(1)).round_seconds());
m_canvas->erase();
m_canvas->print(std::max(0, (m_canvas->get_width() - (int)m_title.size()) / 2 - 4), 0,
+1 -1
View File
@@ -55,7 +55,7 @@ WindowTrackerList::WindowTrackerList(core::Download* d, unsigned int* focus) :
void
WindowTrackerList::redraw() {
// TODO: Make this depend on tracker signal.
m_slotSchedule(this, (cachedTime + 10 * 1000000).round_seconds());
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(10)).round_seconds());
m_canvas->erase();
int pos = 0;