diff --git a/src/core/download_list.cc b/src/core/download_list.cc index eab35a58..4965203a 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -207,6 +207,17 @@ DownloadList::close(Download* download) { } } +void +DownloadList::close_quick(Download* download) { + close(download); + + // Make sure we cancel any tracker requests. This should rather be + // handled by some parameter to the close function, or some other + // way of giving the client more control of when STOPPED requests + // are sent. + download->download()->tracker_list().manual_cancel(); +} + void DownloadList::close_throw(Download* download) { check_contains(download); diff --git a/src/core/download_list.h b/src/core/download_list.h index 6fc1eb18..6403a772 100644 --- a/src/core/download_list.h +++ b/src/core/download_list.h @@ -92,6 +92,7 @@ public: void open_throw(Download* d); void close(Download* d); + void close_quick(Download* d); void close_throw(Download* d); void start_normal(Download* d); diff --git a/src/core/manager.cc b/src/core/manager.cc index 11a19f16..69b56245 100644 --- a/src/core/manager.cc +++ b/src/core/manager.cc @@ -271,7 +271,7 @@ Manager::shutdown(bool force) { if (!force) std::for_each(m_downloadList->begin(), m_downloadList->end(), std::bind1st(std::mem_fun(&DownloadList::pause), m_downloadList)); else - std::for_each(m_downloadList->begin(), m_downloadList->end(), std::bind1st(std::mem_fun(&DownloadList::close), m_downloadList)); + std::for_each(m_downloadList->begin(), m_downloadList->end(), std::bind1st(std::mem_fun(&DownloadList::close_quick), m_downloadList)); } void