From 495d6f2babc9378be7a3da803ba4af71eccde597 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 29 Aug 2007 15:13:20 +0000 Subject: [PATCH] - Save less trackers errors to save memory --- TODO | 3 ++- src/bittorrent.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 5657ca1b4..4dfab6ad6 100644 --- a/TODO +++ b/TODO @@ -38,6 +38,7 @@ - Allow to automatically delete torrents when they reach a given ratio (in options) : easy - Allow to limit the number of downloading torrents simultaneously (other are paused until a download finishes) - Add "Mark all as read" feature for RSS +- Allow to customize lists refreshing interval (in options) // in v1.0.0 (partial) - WIP - Check storage st creation + hasher in torrent creation @@ -47,7 +48,7 @@ - Windows port (Chris - Peerkoel) - write a patch for file_priority(int index), actual_size(); - valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok) -- 134m 35m 16m S 0.3 3.5 4:04.77 qbittorrent +- 129m 30m 16m S 5.8 3.0 0:04.36 qbittorrent * beta 6 - Translations update (IN PROGRESS) - Wait for some bug fixes in libtorrent : diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index e7cee4fd2..7108bda4d 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -40,6 +40,7 @@ #include "deleteThread.h" #define ETAS_MAX_VALUES 8 +#define MAX_TRACKER_ERRORS 2 // Main constructor bittorrent::bittorrent() : timerScan(0), DHTEnabled(false){ @@ -989,7 +990,7 @@ void bittorrent::readAlerts() { if(h.is_valid()){ QString hash = h.hash(); QList > errors = trackersErrors.value(hash, QList >()); - if(errors.size() > 5) + if(errors.size() > MAX_TRACKER_ERRORS) errors.removeAt(0); errors << QPair(QTime::currentTime().toString("hh:mm:ss"), QString::fromUtf8(a->msg().c_str())); trackersErrors[hash] = errors;