Arvid Norberg
57cd2882d4
update symlinks to conform to BEP 47
2019-03-19 10:05:06 +01:00
arvidn
381d5a3c5d
add support for creating symlinks, for torrents with symlinks in them
2019-03-05 22:53:56 +01:00
arvidn
f4f1425115
use UNC paths pervasively on windows
2019-01-12 21:00:40 +01:00
arvidn
1b2832e018
convert some for-loops into std algorithms
2018-11-27 19:43:01 +01:00
arvidn
5383854768
make span's and sha1_hash's index and size types signed (instead of unsigned). Specifically std::ptrdiff_t. In line with the direction of gsl span and reduce signed->unsigned casts
2018-11-16 14:06:22 +01:00
arvidn
78a344bd8b
merged RC_1_1 into master
2018-09-05 08:25:14 -07:00
Arvid Norberg
51003d11ca
add assert to storage
2018-09-04 13:44:24 +02:00
Arvid Norberg
c1b0c70c23
fall back to copy+remove if rename_file fails
2018-08-27 12:30:47 +02:00
arvidn
55215742af
merged RC_1_1 into master
2018-08-25 14:13:51 +02:00
Arvid Norberg
6e80f1f615
improve handling of filesystems not supporting fallocate()
2018-08-22 08:35:22 +02:00
arvidn
b3dbce5790
merge RC_1_1 into master
2018-08-13 09:32:17 +02:00
d_komarov
0bcf6cef23
Fix exporting files
...
To avoid overwriting existing files, before exporting anything from a
parts file, check whether it contains valid data.
2018-08-10 20:21:29 +02:00
arvidn
5530793c75
improve the API for iterating over all files and pieces, with the new strong index types.
2018-06-12 11:44:29 +02:00
Arvid Norberg
794ccf4f79
remove unused disk stats counters
2018-06-05 19:03:04 +02:00
arvidn
267ca40b28
merged RC_1_1 into master
2018-06-02 13:15:13 +02:00
arvidn
c55bc7dd42
improve error handling of failing to change file priority
2018-05-31 00:47:17 +02:00
arvidn
3b0ce8d2e1
merged RC_1_1 into master
2018-05-28 15:56:22 +02:00
arvidn
6ec6c1b340
since moving an existing file into the part file isn't supported, just don't use the partfile for existing files when their priority is set to 0
2018-05-24 23:45:28 +02:00
arvidn
fe612ca167
replace the TORRENT_CFG ABI check with inline namespaces around the symbol that can change ABI based on build configuration options
2018-05-13 19:25:17 +02:00
Alden Torres
83dd6c9c53
cleanup and refactor in storage source code
2018-04-25 16:02:30 -04:00
d-komarov
44479bcca3
Fix storage initialization ( #2944 )
...
If `default_storage::has_any_file` fails during fastresume data check, `piece_manager::check_no_fastresume` will skip storage initialization. In such case, any storage operation that require part file will cause an application crash.
2018-04-21 18:35:55 +02:00
arvidn
f0227451a6
merged RC_1_1 into master
2018-04-13 01:47:41 +02:00
arvidn
aaf9304a3b
update year in copyright header
2018-04-09 09:04:33 +02:00
arvidn
4b144ba451
merged RC_1_1 into master
2018-03-16 13:16:45 +01:00
arvidn
0edb0f28c1
stat files in the disk thread, in default_storage::initialize() instead of the constructor
2018-03-15 14:54:49 +01:00
arvidn
5c1b65e9b8
merged RC_1_1 into master
2018-03-12 02:32:12 +01:00
arvidn
a06e4f696b
track whether a file is eligible for using the partfile on a per-file basis. This is intended to improve backwards compatibility, to better support resuming files downloaded with older versions of libtorrent
2018-03-11 12:52:56 +01:00
arvidn
f8fb5c2294
merged RC_1_1 into master
2018-02-10 22:52:12 +01:00
arvidn
a1860426b8
defer truncating existing files until the first time we write to them
2018-02-10 18:33:41 +01:00
arvidn
15a8a17a6f
merged RC_1_1 into master
2018-02-05 08:55:15 +01:00
arvidn
91e03c789c
fix issue resuming 1.0.x downloads with a file priority 0
2018-01-31 22:43:07 +01:00
arvidn
0fe2e85fee
fix part-file creation race condition (back-port from master)
2017-12-03 18:13:54 +01:00
arvidn
6785046c2f
introduce a download_priority_t type, for uniform an type-safe piece- and file priorities
2017-11-02 08:20:21 +01:00
Alden Torres
f02e7514e1
fix issue of null m_part_file in default_storage readv/writev ( #2490 )
...
call need_partfile if necessary in default_storage constructor and no .reset() in release_files()
2017-10-31 16:49:58 +01:00
Alden Torres
b380bf8059
minor and general code cleanup/refactor
2017-10-25 09:58:47 +02:00
Alden Torres
1ce3483a9e
creating part file if needed only in set_file_priorities
2017-10-24 09:56:49 +02:00
Steven Siloti
0232dc35cd
deprecate lock_files ( #2344 )
...
File locking interacts poorly with the path to replace a read only file handle
with a read/write one. For performance reasons the old handle is not closed
until the new one is put in place. With file locking this obviously cannot
work because the first handle is holding a lock on the file. As a result,
file_pool::open_file fails in this case. Even if we dropped the reference to
the read only file handle before attempting to re-open it, the open could still
fail if another thread is holding a reference to the read only handle.
There doesn't seem to be a good way around this. The simple solution would be
to always open files in read/write mode, but that has obvious safety downsides.
Any other solution would significantly complicate the file pool code.
Deprecating file locking seems to be the least bad option.
2017-09-17 10:43:27 +02:00
arvidn
c848f6d978
improve some asserts in storage.cpp
2017-09-07 23:00:58 +02:00
arvidn
865ff09a84
merge RC_1_1 into master
2017-08-10 16:44:57 +02:00
arvidn
378a0e974b
fix issue of force-recheck or seeding from read-only media, torrents with empty files in them. Previously libtorrent would create empty files up-front unconditionally, now they won't be created if they already exist
2017-08-09 18:48:49 +02:00
arvidn
1f3730fa5a
fix force-recheck issue (new files would not be picked up)
2017-08-06 09:49:51 +02:00
arvidn
322007bb6a
make save_state_flags a strong type
2017-07-30 09:06:41 -07:00
arvidn
c4afb5e949
use a dedicated class template for flags types instead of enum class. It's more backwards compatible and improves ergonomics
2017-07-15 01:15:57 -07:00
arvidn
5c37eb174f
drop support for windows compilers without std::string and wchar_t (believed to be old cygwin)
2017-07-02 08:24:55 -04:00
arvidn
ed79929528
factor out has_any_file to storage_utils
2017-06-23 16:33:48 -04:00
arvidn
b7642f75d5
move clear_bufs out of storage.cpp into storage_utils
2017-06-21 13:04:05 -04:00
arvidn
77cc2b4eea
fix re-check issue after move_storage
2017-06-20 22:27:39 -04:00
arvidn
aa842948a3
storage_params cleanup
2017-06-20 10:27:28 -04:00
arvidn
ff454a92d4
unify some operation-enums and strings to use operation_t
2017-06-18 07:31:45 -04:00
Arvid Norberg
5344761da4
make flags to move_storage a proper enum class ( #2043 )
2017-06-01 04:15:15 -04:00