Commit Graph

57 Commits

Author SHA1 Message Date
arvidn 69d85ed110 replace use of deprecated shared_ptr<>::unique with shared_ptr<>::use_count 2019-12-12 19:40:39 +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
Arvid Norberg 8be9b3d976 merged RC_1_1 into master 2018-09-19 12:23:08 -07:00
arvidn 8cc93e9855 fix redundant flushes of partfile metadata 2018-09-12 07:47:13 -07:00
Arvid Norberg ab56bf964f fix missing move of file object in part_file 2018-06-24 21:34:56 +02:00
arvidn f5a2015302 merge RC_1_1 into master 2018-06-19 22:26:01 +02:00
arvidn 4ae262d2d4 fix race condition in part_file 2018-06-19 14:50:02 +02:00
d-komarov 81ce7aa4ab Fix parts file i/o errors (#3110)
Since i/o operations are not synchronized, it is possible that one thread closes file handle, opened in another thread. With addition of `hidden` file attribute, an old bug in `part_file::open_file()` revealed both problems, causing a lot of random i/o errors in parts file. Fixing `open_file` bug should reduce the number of such errors back to 'normal'.
2018-06-18 14:34:39 +02:00
arvidn 3b0ce8d2e1 merged RC_1_1 into master 2018-05-28 15:56:22 +02:00
arvidn ed8fffc1a6 set the hidden attribute when creating the part file 2018-05-23 10:39:10 +02:00
Alden Torres 7621be6df1 fixed signed/unsigned warnings with latest version of Xcode clang (#3032) 2018-05-16 16:06:33 +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
Arvid Norberg a5e0578c88 fix part-file header allocation 2018-04-03 20:46:49 +02:00
arvidn 65fef972a2 apply some c++11 modernization 2018-01-11 04:51:39 -05: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
Alden Torres 10bfe18ebe added consts and minor code formatting 2017-07-03 16:58:49 -04: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 cef9773c70 generalize part_file::export_file to pass back the buffers to a callback function 2017-04-15 20:01:18 -04:00
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -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
Arvid Norberg 13b16a63a3 use unsigned type for file flags. make file_pool private to disk_io_thread (#1894)
use unsigned type for file flags. make file_pool private to disk_io_thread. move close_file_interval logic to the disk thread. don't expose file in public interface, and make pool_file_status properly public (not part of file_pool and renamed to open_file_status), this is exposed in public interface via torrent_handle::file_status()
2017-04-08 18:24:50 -04:00
Alden Torres a5825c0d2e fixing sign-conversion warnings, part 5, minor refactor (#1559)
fixing sign-conversion warnings, part 5, minor refactor
2017-01-16 21:51:49 -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 cda715c152 introduce type for slot index in part_file 2016-12-26 08:33:19 -08:00
Arvid Norberg 3f1084d63d strengthened type safety in handling of piece and file indices (#1409)
strengthened type safety in handling of piece and file indices
2016-12-22 10:42:33 -05:00
Alden Torres 22b596945e enable /W4 warnings for msvc 2016-12-13 19:36:14 -05:00
Alden Torres f382936d56 headers, end of file, code cleanup 2016-12-12 23:36:45 -05:00
Alden Torres d9f8d4b642 refactor to more use of auto c++11 keyword (#1404)
refactor to more use of auto c++11 keyword
2016-12-11 20:50:30 -05:00
Alden Torres 3a92908f39 formatting, added std:: and spaces 2016-12-10 23:11:43 -05:00
Alden Torres dd7179fb10 added a few consts to arguments and local variables 2016-12-10 18:19:14 -05:00
Alden Torres 7266b0b360 fixing shorten-64-to-32 warnings, part 4 2016-12-09 17:24:07 -05:00
Alden Torres d5c4cd7280 fixed sign-compare warnings and some refactor (#1354)
fixed sign-compare warnings and some refactor. make sequence_number backed by std::int64_t
2016-11-27 08:46:53 -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
Arvid Norberg 6148984426 remove whitespace at end of line (#1245) 2016-10-22 11:47:24 -04:00
Alden Torres 01e9810f7a more boost types cleanup and handling of deprecated macos libcrypto (#1072)
more boost types cleanup and handling of deprecated macos libcrypto. more granular TORRENT_MACOS_DEPRECATED_LIBCRYPTO
2016-09-07 17:51:18 -04:00
Alden Torres 3faa771843 removed use of boost::bind and boost::scoped_array (#1053) 2016-09-01 09:43:53 -04:00
arvidn 42b3fbe20a merged RC_1_1 into master 2016-08-07 17:23:40 -04:00
Steven Siloti bc369683df handle short reads when exporting a file (#990)
handle short reads when exporting a file. Pieces in the part file are not guaranteed to be fully written so short reads need to be handled rather than asserting.
2016-08-07 16:04:29 -04:00
Arvid Norberg 6aabe3762b general modernization (#836)
general modernization. use nullptr instead of NULL, use std::tuple instead of boost::tuple, transition some unordered set/map from boost to std. some clean-up of includes
2016-06-20 11:32:06 -04:00
Arvid Norberg ed077c8358 use cstdint intead of boost/cstdint.hpp (#833)
use cstdint intead of boost/cstdint.hpp
2016-06-18 14:01:38 -04:00
arvidn dfc2206b9f merged RC_1_1 into master 2016-06-11 01:00:41 -04:00
Arvid Norberg 5ecd00c5c5 fix osx build (#804)
fix osx build with asserts enabled
2016-06-11 00:48:13 -04:00
Arvid Norberg 748af6eec1 general cleanup. remove valgrind markup, log_hash_failures and C headers (#752)
general cleanup. remove valgrind markup, log_hash_failures and C headers
2016-05-23 08:15:39 -04:00
Arvid Norberg c91a700c07 Msvc warnings (#685)
fix msvc warnings and build examples with warnings-as-errors
2016-05-02 12:36:21 -04:00
Arvid Norberg 20b41ad0b9 Threads (#671)
use std::thread, std::mutex, std::condition_variable instead of pulling them in from boost.asio internals.
2016-04-30 18:54:23 -04:00
arvidn dff0e7b0cd fix concurrency issue in part_file::export_file 2016-04-02 21:29:20 -04:00
arvidn 1f9f588e75 merge copyright year update and changelog from RC_1_0 2016-01-17 18:57:46 -05:00
arvidn 8d8c049d9e fix warnings and invalid defines in disk_io_thread.cpp 2015-08-18 07:55:50 -04:00