Commit Graph

68 Commits

Author SHA1 Message Date
arvidn e4de026c9a expose mmapped file_open_mode flag 2022-09-21 01:25:48 +02:00
arvidn 2eb6c21995 improve error reporting from file opy and move 2022-09-16 08:53:51 +02:00
arvidn bcdf76a6fc remove file class. use file_handle instead 2022-08-10 13:17:35 +02:00
arvidn 550d3c7d9f update copyright headers 2022-06-22 21:42:55 +02:00
arvidn 940a515f60 remove unused recursive_copy function 2022-02-10 09:37:03 +01:00
arvidn cf8945ad64 move exists() function that ignore errors to test utils, and clean up use in posix_storage and mmap_storage 2021-02-05 01:40:15 +01:00
arvidn fa53a4d723 merged RC_1_2 into RC_2_0 2021-01-26 23:17:05 +01:00
arvidn 14473d07af fix the complete() function, turning a path into an absolute path, to correctly strip the ./ prefix of a relative path 2021-01-26 15:39:55 +01:00
Arvid Norberg 24a362e696 simplify file class 2020-11-18 03:17:26 +01:00
Arvid Norberg 31622459fd update copyright 2020-11-14 20:25:15 +01:00
Arvid Norberg 14e334879b add wrapper around std::ofstream to simplify tests that creates files 2020-09-15 10:37:49 -07:00
Arvid Norberg 8ab7b8258b separate directory class from file.hpp. use fopen/fclose/fread in torrent_info, instead of file class. introduce a light abstraction around FILE* 2020-09-12 08:56:50 -07:00
arvidn 3b91d9b095 fix typo in file_open_mode conversion 2019-12-28 14:57:34 +01:00
arvidn d3f7a363c2 update copyright year 2019-08-29 00:13:04 +02:00
arvidn 86e11142a1 merged RC_1_2 into master 2019-08-10 21:11:10 -07:00
Steven Siloti 1a7ccf240f generate v2 metadata 2019-08-10 09:28:38 -07:00
arvidn 8e23f9cc92 improve file_storage::sanitize_symlinks 2019-07-29 06:10:04 -07:00
arvidn d6fc57f10e merged RC_1_2 into master 2019-03-23 10:06:22 +01:00
arvidn 2990532d10 reduce the amount of hacky path/string handling code 2019-03-22 07:48:07 +01:00
Arvid Norberg 57cd2882d4 update symlinks to conform to BEP 47 2019-03-19 10:05:06 +01:00
arvidn 5f85e40193 remove old, hacky and unused split_string() function 2019-03-19 09:27:06 +01:00
arvidn 8305c40d6a make disk_interface the customization point for storage, rather than storage_interface
remove the disk cache
remove trim_cache disk job
remove zero-storage
mark default_storage_constructor as deprecated
remove storage_interface
remove file_pool and default_storage_constructor. update connection_tester to use disk_io_thread.
only ftruncate files once
optimize hashing, by running sha1 directly on the memory mapped file
use boost-multi_index in file_view_pool
remove flush_piece and flush_hashed, simplify job-fence logic, remove prep_read_job_impl
support noatime
split out mmap implementation into a .cpp file
support hashing of content in part files. wraps up new disk storage
remove flush_piece disk job
separate out store_buffer into its own class
pass session_settings into storage operations instead of assigning a pointer in the storage object
use unordered_map in store_buffer
add fopen-based disk io back-end for non-64 bit systems or systems without mmap
factor out open_mode_t into its own header
first stab at windows memory mapped files support
build all of boost for autotools
remove flag in async_read callback handler
remove old open_mode_t, preadv/readv and coalesce buffers
support sparse and no_cache file flags in mmap
Remove use of overlapped I/O because we're no longer doing any scatter/gather syscalls the use of overlapped is an unnecessary complication.
don't explicitly specify global read and write. On MINGW we need to use libtorrent::read and libtorrent::write instead of the MINGW provided ::read and ::write.

If the underlying file is empty then m_mapping is expected to be null.
It is the caller's responsibilty to notice that the region's size is
zero and not dereference it in that case.

Otherwise there is no good way for users of default_storage::open_file
to determine that the opened file is empty.
2019-01-20 18:29:42 +01:00
arvidn f4f1425115 use UNC paths pervasively on windows 2019-01-12 21:00:40 +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 1f9e74f40d merged RC_1_1 into master 2018-11-06 23:57:04 +01:00
Arvid Norberg cec300234c fix move_storage with save_path with a trailing slash 2018-11-06 23:46:18 +01:00
arvidn 6be8b395da some cleanup turning memcmp() and memcpy() into span comparisons and std::copy(). some more use of random_bytes() instead of loops. 2018-11-05 18:52:45 +01:00
arvidn 2e4713b223 merged RC_1_1 into master 2018-07-13 01:57:04 +02:00
Andrei Kurushin 7a34b27499 fix Windows "file::preadv" emulation EOF handling 2018-07-12 23:54:34 +02:00
Andrei Kurushin 5399a14027 Windows async read EOF handling (#3162)
fix Windows "file::preadv" emulation EOF handling
2018-07-12 23:30:50 +02:00
arvidn 9696082355 merged RC_1_1 into master 2018-02-25 09:36:12 +01:00
d-komarov 3acc5732a2 Add file test workaround (#2804)
File test compiled with TORRENT_USE_UNC_PATHS produces file that cannot
be removed.
2018-02-21 12:29:37 +01:00
Alden Torres 2d3e394226 fixing warnings in tests code, part10, final 2018-02-02 20:59:01 +01:00
Alden Torres 6d5b90968b fixing warnings in tests code, part4 2018-01-27 09:18:26 +01:00
Alden Torres 8d379dd944 fixing warnings in tests code, part3 2018-01-25 09:09:21 +01: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 ffaabd846c make file open mode flags be an enum class for type-safety 2017-05-28 11:16:59 -04:00
arvidn 749d0da875 make iovec_t an alias for span<char>, in preparation for removing it altogether in favour of span 2017-04-30 11:49:08 -04:00
arvidn d138f02424 introduce lt namespace alias 2017-04-23 23:43:58 -04:00
arvidn 79d7ae3638 separate path and filesystem functions out into its own translation unit/header file pair, separating it from the file and directory class 2017-04-11 18:07:55 -04:00
arvidn 1dd0e9b280 use string_view instead of strcmp 2017-03-18 15:54:38 -04:00
Andrei Kurushin 9bee2146d0 complete UNC path support (#1689)
complete UNC path support. all internal file api functions handle long size paths (> MAX_PATH) and special names (CON,PRN ...) with unit test
2017-02-16 23:47:08 -05:00
Arvid Norberg 3d06371f31 factor out some common storage utilities out of storage.cpp (#1515)
factor out some common storage utilities out of storage.cpp
2017-01-11 00:42:10 -05:00
arvidn cde9457fdb fix merge issue 2016-12-22 01:13:17 -05:00
Steven Siloti f5366bd816 use span for scatter/gather lists (#1260)
use span for gather/scatter buffers. remove explicit size parameter from file_op
2016-10-26 20:40:56 -04:00
arvidn 6c805bd06d simplify print statements in tests 2016-10-09 20:23:45 -04:00
arvidn 9453fbd54b merged RC_1_1 into master 2016-10-09 20:09:44 -04:00
Arvid Norberg 6bb2d7c017 Sanitize 1.1 (#1197)
enable address sanitizer
2016-10-09 17:00:20 -04:00
Alden Torres 158ae3a4ba consts, minor refactor, typos and test (#1142) 2016-09-23 13:49:39 -07:00
Alden Torres 9fd83aaa10 more use of std::shared_ptr (#1009)
more std::shared_ptr transition
2016-08-18 17:08:40 -04:00