From e460f1c365016b27a61b07b9e07a7812192c6743 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 28 Nov 2009 15:03:27 +0000 Subject: [PATCH] - Attempt to speed up exit --- src/bittorrent.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 33b5010e8..fa670affb 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -108,6 +108,9 @@ Bittorrent::~Bittorrent() { saveDHTEntry(); saveSessionState(); saveFastResumeData(); + // Delete session + session_proxy sp = s->abort(); + delete s; // Disable directory scanning disableDirectoryScanning(); // Delete our objects @@ -125,10 +128,7 @@ Bittorrent::~Bittorrent() { delete httpServer; if(timerETA) delete timerETA; - // Delete BT session - qDebug("Deleting session"); - delete s; - qDebug("Session deleted"); + qDebug("Deleting session..."); } void Bittorrent::preAllocateAllFiles(bool b) { @@ -293,6 +293,8 @@ void Bittorrent::configureSession() { sessionSettings.use_dht_as_fallback = false; // To prevent ISPs from blocking seeding sessionSettings.lazy_bitfields = true; + // Speed up exit + sessionSettings.stop_tracker_timeout = 1; //sessionSettings.announce_to_all_trackers = true; #ifdef LIBTORRENT_0_15 sessionSettings.announce_to_all_tiers = true; //uTorrent behavior