summarylogtreecommitdiffstats
path: root/ps-close_lowdisk_normal_all.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ps-close_lowdisk_normal_all.patch')
-rw-r--r--ps-close_lowdisk_normal_all.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/ps-close_lowdisk_normal_all.patch b/ps-close_lowdisk_normal_all.patch
new file mode 100644
index 000000000000..3a7f55f41478
--- /dev/null
+++ b/ps-close_lowdisk_normal_all.patch
@@ -0,0 +1,28 @@
+--- a/src/command_events.cc
++++ b/src/command_events.cc
+@@ -216,7 +216,7 @@ void apply_import(const std::string& path) { if (!rpc::parse_command_file(pa
+ void apply_try_import(const std::string& path) { if (!rpc::parse_command_file(path)) control->core()->push_log_std("Could not read resource file: " + path); }
+
+ torrent::Object
+-apply_close_low_diskspace(int64_t arg) {
++apply_close_low_diskspace(int64_t arg, uint32_t skip_prio) {
+ core::DownloadList* downloadList = control->core()->download_list();
+
+ bool closed = false;
+@@ -224,7 +224,7 @@ apply_close_low_diskspace(int64_t arg) {
+
+ while ((itr = std::find_if(itr, downloadList->end(), std::mem_fun(&core::Download::is_downloading)))
+ != downloadList->end()) {
+- if ((*itr)->file_list()->free_diskspace() < (uint64_t)arg) {
++ if ((*itr)->priority() < skip_prio && (*itr)->file_list()->free_diskspace() < (uint64_t)arg) {
+ downloadList->close(*itr);
+
+ (*itr)->set_hash_failed(true);
+@@ -391,5 +391,6 @@ initialize_command_events() {
+ core::Manager::create_quiet | core::Manager::create_start | core::Manager::create_raw_data));
+
+- CMD2_ANY_VALUE ("close_low_diskspace", tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2));
++ CMD2_ANY_VALUE ("close_low_diskspace", tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2, 99));
++ CMD2_ANY_VALUE ("close_low_diskspace.normal", tr1::bind(&apply_close_low_diskspace, tr1::placeholders::_2, 3));
+
+ CMD2_ANY_LIST ("download_list", tr1::bind(&apply_download_list, tr1::placeholders::_2));