From dd2e605796e0b0adc177022e8495576a0f4bbe3f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 7 Jun 2014 02:57:24 +0000 Subject: [PATCH] don't use full allocation on network drives (on windows) --- ChangeLog | 1 + src/storage.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8da64e9ff..6e3e366aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 1.0 release + * don't use full allocation on network drives (on windows) * added clear_piece_deadlines() to remove all piece deadlines * improve queuing logic of inactive torrents (dont_count_slow_torrents) * expose optimistic unchoke logic to plugins diff --git a/src/storage.cpp b/src/storage.cpp index 82cac0cc8..b303a1aa0 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -405,6 +405,14 @@ namespace libtorrent bool default_storage::initialize(bool allocate_files) { m_allocate_files = allocate_files; + +#ifdef TORRENT_WINDOWS + // don't do full file allocations on network drives + int drive_type = GetDriveType(m_save_path.c_str()); + if (drive_type == DRIVE_REMOTE) + m_allocate_files = false; +#endif + error_code ec; m_file_created.resize(files().num_files(), false);