Commit Graph

654 Commits

Author SHA1 Message Date
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 f16d0b7953 add unit test for 'file_sizes' entry in resume data (#1248)
add unit test for 'file_sizes' entry in resume data. fix resume data bug in client_test for magnet links and minor resume data cleanup in default_storage
2016-10-23 22:01:09 -04:00
Steven Siloti a6e5ba8804 return a span from TORRENT_ALLOCA (#1244)
return a span from TORRENT_ALLOCA

Unfortunately this requires moving the variable declaration inside the macro.
Due to alloca’s unique properties pretty much the only safe way to call it is
in a simple assign-to-pointer expression. Therefor we need to use a temporary
pointer to store the value returned from alloca before we can call span’s ctor.

This also causes double evaluation of the size parameter which is unfortunate,
but no current callers of TORRENT_ALLOCA have a problem with this. Passing
expressions with side effects to macros is bad mojo anyways.
2016-10-22 14:43:40 -04:00
Arvid Norberg c18c12a144 remove ghost torrent/torrent eviction feature. (#1214)
remove ghost torrent/torrent eviction feature. It was very complex and did not solve the problem very well
2016-10-15 13:32:59 -04:00
Arvid Norberg f592d7fcb0 various cleanup and formatting updates (#1158) 2016-09-26 20:05:04 -04:00
Alden Torres b1b74657f6 added consts and minor refactor (#1137)
added consts and minor refactor
2016-09-23 13:51:20 -07:00
Alden Torres 29a4075555 refactor to use std::shared_ptr with dht observer (#1057)
refactor to use std::shared_ptr with dht observer
2016-09-02 21:05:11 -04:00
Alden Torres cdb15ba886 refactor to use std::shared_ptr with torrent (#1048) 2016-08-31 08:27:36 -04:00
Alden Torres 4d96939b7b minor cleanup and refactor (#1016)
minor cleanup and refactor
2016-08-20 19:46:55 -04:00
Alden Torres 5789b02e1b storage_interface refactor to use span and references (#1007)
storage_interface refactor to use span and references
2016-08-18 11:57:50 -04:00
arvidn 83dba91168 use span for to_hex and from_hex functions 2016-07-29 18:42:18 -04:00
Arvid Norberg a740a49fd6 modernize misc (#898)
modernize misc
2016-07-10 07:34:45 -04:00
Arvid Norberg e782783814 modernize use override (#895) 2016-07-09 20:10:38 -04:00
Arvid Norberg 770935cd46 modernize-use-nullptr (#894) 2016-07-09 16:26:26 -04:00
arvidn 98af1cd54e merged RC_1_1 into master 2016-07-05 18:03:06 -04:00
Arvid Norberg 97ad7510af minor refactoring to move-storage patch (#680)
minor refactoring to move-storage patch
2016-06-29 20:05:28 +03:00
Vladimir Golovnev faef995cdc Move storage "file-by-file" (#632)
When moving storage for a torrent, only move files belonging to the torrent, one by one.
2016-06-29 20:05:16 +03:00
Arvid Norberg a675682b6c some cleanup of TORRENT_DEBUG defines (#863)
some cleanup of TORRENT_DEBUG defines
2016-06-27 22:28:51 -04:00
terry zhao 1a3e75b50a fix msvc-8.0 build (#860) 2016-06-27 13:46:15 -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
Alden Torres 38f4765ebc added assert and documentation typos (#816) 2016-06-13 17:16:09 -04:00
Arvid Norberg 8c8f5bb03b deprecated public to_hex() and from_hex() functions (#784) 2016-06-04 10:01:43 -04:00
Arvid Norberg 96999ad67f replace uses of boost::bind with std::bind and lambdas (#745) 2016-05-25 00:31:52 -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 e8380e1d0b factor out includes from config.hpp into the files actually using it. primarily, printf family of functions, since C++11 version is used now. This removes the need for an snprintf-wrapper on windows (#732) 2016-05-17 09:24:06 -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
Alden Torres 8ae1e9a21d Moved disabled_storage and zero_storage for a private namespace in the compilation unit (#687) 2016-05-01 23:16:00 -04:00
Arvid Norberg 0d5428a664 minor refactoring to move-storage patch (#680)
minor refactoring to move-storage patch
2016-05-01 12:23:02 -04:00
Arvid Norberg 770afadcda use std::atomic instead of boost::atomic (#678)
use std::atomic instead of boost::atomic
2016-05-01 03:38:35 -04:00
Vladimir Golovnev 64cb8b236a Move storage "file-by-file" (#632)
When moving storage for a torrent, only move files belonging to the torrent, one by one.
2016-04-30 22:18:38 -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
Arvid Norberg 4e97bf556c use override and final keywords (unconditionally) (#668)
use override and final keywords instead of macros.
2016-04-30 11:05:54 -04:00
Andrei Kurushin 62eb956c54 fix x64 build with VS2015 UP2 compiler (#640)
fix VS2015 compiler warnings for: address-model=64, deprecated-functions=on, link=shared
2016-04-25 17:22:09 -04:00
arvidn dec093dc1a Merge branch 'RC_1_1' 2016-04-24 15:41:28 -04:00
Arvid Norberg a9f07a29bd fix move_storage error handling bug (#638) 2016-04-23 10:02:52 -04:00
Andrei Kurushin 7b5d48c02a fix default release build with VS2015 UP2 compiler warnings (#624)
* fix default release build with VS2015 UP2 compiler warnings
this will allow to successfully build:
bjam toolset=msvc-14.0 release deprecated-functions=off character-set=unicode link=static warnings-as-errors=on
2016-04-17 16:56:07 -04:00
arvidn 867b83ccda merged RC_1_1 into master 2016-04-08 02:20:24 -04:00
arvidn 6bc5de5903 fail correctly when move_storage is called to move into its own directory 2016-04-02 10:03:31 -04:00
arvidn b16f43132b Merge branch 'RC_1_1' 2016-03-20 20:39:49 -04:00
arvidn 0095aa084f make coalesce reads and coalesce writes actually work 2016-03-20 16:34:19 -04:00
arvidn f79a9c7adf merged RC_1_1 into master 2016-03-16 19:59:53 -04:00
arvidn 921cbeebed add option to delete just the partfile when removing a torrent 2016-03-14 08:26:39 -04:00
arvidn e1f4b5ad2d fix typo in reporting file index in checking resume data 2016-03-02 18:43:16 -05:00
arvidn 2b6fdc1728 attempt to fix issue where the partfile is not deleted when asking to delete all files 2016-02-28 16:05:13 -05:00
arvidn c9d7e54d7b make tests pass 2016-02-20 12:50:52 -05:00
arvidn 8135ea326f rename async_check_fastresume to async_check_files, and make it take an add_torrent_params object instead of bencoded resume data 2016-02-20 02:00:07 -05:00
arvidn 197ded5a0d revamp the way resume data is read, by providing a function for the client to parse resume data, capturing it in add_torrent_params 2016-02-20 02:00:06 -05:00
arvidn 660647b590 improve abstraction level of stats cache and fix test 2016-02-06 15:51:00 -05:00
arvidn ae7058e119 remove the timestamps and file sizes from the resume data. This makes saving resume data alot cheaper, since it doesn't have to go via the disk thread. It also removes an old-standing API usage issue where there was easily a race condition introduced between saving resume data and pausing a torrent. 2016-02-06 15:50:55 -05:00
arvidn 73289cb8ae fix use of uninitialized variables in default_storage 2016-01-25 19:11:57 -05:00
Alden Torres 5c94b286b0 Removed file::m_path windows specific field
Removed default_storage::sparse_end
Typos
2016-01-21 12:11:33 -05:00
arvidn 1f9f588e75 merge copyright year update and changelog from RC_1_0 2016-01-17 18:57:46 -05:00
arvidn 4cc2e879c4 comment out verbose pex logging. fix bug in disabled_storage and an error reporting issue on short reads in default_storage 2016-01-10 11:50:56 -05:00
arvidn 964031c070 factor out readwritev to a free function, to allow unit testing of it 2015-11-19 17:58:55 -05:00
arvidn cec6748e0c remove the concept of slots, and just talk about pieces (since we don't do compact allocation anymore). Remove the section about compact allocation 2015-11-19 01:38:04 -05:00
arvidn fb2f2731cf fix support for incomplete reads/writes from disk 2015-11-14 00:21:03 -05:00
arvidn ced0f74bf8 minor moving around of code 2015-11-06 00:38:42 -05:00
arvidn e31433d952 flush and close the partfile when releasing files in default storage 2015-10-24 15:35:42 -04:00
arvidn a2ea8b32db fix more warnings 2015-09-06 22:55:41 -04:00
arvidn 17c5759829 disable warning for unused command line argument and fix warnings. remove redundant travis build config. use new preprocessor on clang to avoid warnings 2015-09-06 22:55:41 -04:00
arvidn bd177a857f make tailequeue a template, introduce type safety, remove old-style casts 2015-08-19 15:22:05 +02:00
arvidn 9a0092c120 fix some warnings 2015-08-16 12:17:23 -04:00
arvidn 16bb2de6ed fix some warnings 2015-08-13 23:52:25 -04:00
arvidn a81ca2391b fix some warnings 2015-08-10 20:03:24 -04:00
Alden Torres 5866bb7974 Indentation. 2015-08-03 18:16:43 -04:00
Alden Torres cd8a4d2511 Moved TORRENT_DISK_STATS to default_storage with the option of enable/disable at runtime. 2015-08-03 18:16:43 -04:00
arvidn e0c3d28321 fix some warnings 2015-08-02 15:55:05 -04:00
arvidn 655a3ae019 fix some warnings 2015-08-01 23:57:11 -04:00
arvidn 41533205be drop support for boost 1.35 and fix some more references to the asio namespace 2015-06-06 02:10:53 -04:00
Arvid Norberg d43f7b56a2 update copyright year 2015-06-03 05:18:48 +00:00
Arvid Norberg 051ca6b22c fix warnings 2015-05-18 05:32:18 +00:00
Arvid Norberg 2fff222235 silence some warnings on msvc 2015-04-27 02:21:12 +00:00
Arvid Norberg f0336017d1 fix gcc warnings and missing header files in makefiles 2015-04-26 00:51:44 +00:00
Arvid Norberg 3951377d95 fix include paths for warning push and pop headers 2015-04-21 01:16:28 +00:00
Arvid Norberg 4d15f1410f fix warnings, some clean-up and todo comments 2015-04-20 04:52:49 +00:00
Arvid Norberg 21751347bc more warnings fixes and cleanup 2015-04-19 06:28:21 +00:00
Arvid Norberg 408232cfc8 raise warning level. fix a few of them. filter out warnings from boost 2015-04-18 02:33:39 +00:00
Arvid Norberg 8ac5a32548 improve deprecation macros. increase default warning level. fix deprecation warnings while building libtorrent itself (gcc and clang) 2015-04-17 01:49:49 +00:00
Arvid Norberg ccc7e45406 landed mutable torrents branch in trunk 2015-03-21 00:12:40 +00:00
Arvid Norberg 794de25212 moved escape_string.hpp into the aux_ directory. moved out the 3 public hex functions into its own public header, hex.hpp 2015-03-14 23:10:20 +00:00
Arvid Norberg 6c1df7eb55 landed the bdecode branch in master. lazy_bdecode/lazy_entry is now being replaced by bdecode/bdecode_node 2015-03-12 05:20:12 +00:00
Arvid Norberg c1dc982f4f deprecate the ptime type and related time types. just use boost::chrono / std::chrono 2015-03-12 04:34:54 +00:00
Arvid Norberg 10333221bc attempt at fixing file permission issues on windows 2015-03-09 06:09:50 +00:00
Arvid Norberg 89055c4c7a some more optimizations on loading torrents 2015-02-18 03:32:49 +00:00
Arvid Norberg c4a294e88a deprecate file_base feature in file_storage/torrent_info 2015-02-17 04:53:49 +00:00
Arvid Norberg 40980df545 extend storage unit test to cover iovec operations 2015-02-15 07:31:35 +00:00
Arvid Norberg 9172874b5c fix storage error (recently introduced) where the mapped_files object would not be updated when renaming files that did not exist on disk 2015-01-13 18:28:06 +00:00
Arvid Norberg f839b8c9b4 factor creating of directories into default_storage::open_file to make that functionality more robust and fix a bug where moving files out of the part-file would fail because the directories hadn't been created yet 2015-01-03 16:57:21 +00:00
Arvid Norberg ae47823970 don't fail renaming a file in a torrent just because it doesn't exist (and the destination directory doesn't exist) 2014-12-26 21:25:37 +00:00
Arvid Norberg 1ed1963f29 remove size_type typedef in favor of boost::int64_t 2014-12-03 04:32:50 +00:00
Arvid Norberg 0bcbe433ed deprecate most of cache_status type (use session stats instead) 2014-10-25 20:07:50 +00:00
Arvid Norberg d287ce9c46 fix issue when hash checking files resulting in a short read 2014-10-12 23:49:51 +00:00
Arvid Norberg 649d7646fb test build fix. another boost.chrono overflow issue fixed 2014-09-02 08:01:09 +00:00
Arvid Norberg c60ceacb71 switch over to use boost.atomic instead of home-built one 2014-08-01 07:32:54 +00:00
Arvid Norberg 374380667c make default_storage a bit more robust 2014-07-10 01:59:35 +00:00
Arvid Norberg 7351389ce8 land libtorrent_aio branch in trunk 2014-07-06 19:18:00 +00:00
Arvid Norberg 6c6fe4dfe2 merged fixes of warnings from RC_1_0 2014-07-04 23:40:31 +00:00
Arvid Norberg 6043e14131 remove pch.hpp 2014-06-28 23:45:46 +00:00
Arvid Norberg 3f4eba1bdb web seed and storage fixes 2014-06-21 06:58:39 +00:00
Arvid Norberg 3e5ab73127 fix windows build 2014-06-09 04:08:41 +00:00
Arvid Norberg dd2e605796 don't use full allocation on network drives (on windows) 2014-06-07 02:57:24 +00:00
Arvid Norberg 4deafb5e29 add workaround for GCC bug in MingW (broken support for PVOID64) and improve resiliency of storage 2014-05-23 02:09:27 +00:00
Arvid Norberg e225259481 fix some msvc warnings 2014-05-10 03:23:05 +00:00
Arvid Norberg b643962bfe merged fixes from RC_0_16 2014-03-06 10:06:41 +00:00
Arvid Norberg a0a41b6c5e merged file priority fix from RC_0_16 and keep the disk thread's file priorities up to date 2014-02-28 10:19:29 +00:00
Arvid Norberg a943fec777 update copyright 2014-02-23 19:12:25 +00:00
Arvid Norberg 0398dfe498 merged storage allocation mode fix from RC_0_16 2014-02-07 08:58:52 +00:00
Arvid Norberg 05aa06460d fix merge error 2014-01-26 02:40:09 +00:00
Arvid Norberg ce2805a258 merged lt_tex fix from RC_0_16 2014-01-26 01:17:58 +00:00
Arvid Norberg e0644ce8f5 invariant check macro fixes 2014-01-21 19:26:09 +00:00
Arvid Norberg 702b68ecc4 clean up assert related defines and debuf-only fields less error-prone. fix missing initialization in file_pool caused by mistake in defines under which the debug field was initialized 2014-01-19 19:45:50 +00:00
Arvid Norberg 5b46be916b merged storage fix from RC_0_16 2013-12-30 02:50:29 +00:00
Arvid Norberg 4e6b1cfbfb update copyright 2013-12-25 17:07:16 +00:00
Arvid Norberg ea0aa72cce fix resume data bug introduced when deprecating the iterators from file_storage 2013-11-07 06:54:56 +00:00
Arvid Norberg aef04aca5b merged move_storage fix from RC_0_16 2013-10-28 05:07:55 +00:00
Arvid Norberg 1a0d798ac9 fixed typo in file_storage API deprecation 2013-08-17 01:35:39 +00:00
Arvid Norberg 3bd53f88ef fix build with internal_file_entry being deprecated without deprecated functions 2013-08-12 07:30:57 +00:00
Arvid Norberg 8f3723cdef support renaming files to absolute paths 2013-06-09 22:30:02 +00:00
Arvid Norberg 0a09eeca9f merged changes from RC_0_16 2013-05-11 22:57:08 +00:00
Arvid Norberg bdf0e1764b merged fixes from RC_0_16 2013-05-11 22:00:54 +00:00
Arvid Norberg cf7a2a098e fix move_storage fail_if_exist logic. First check to see if the root folder exists, as an early exit 2013-05-11 21:41:42 +00:00
Arvid Norberg 90a2509d68 fix bug in recent move_storage patch 2013-05-10 02:18:14 +00:00
Arvid Norberg 982a14c2e9 extend move_storage functionality to have more flexible behavior 2013-05-09 02:50:16 +00:00
Arvid Norberg 6ea6bf9e92 revert mistake 2013-04-01 08:37:21 +00:00
Arvid Norberg 1ce4b2b531 fix error handling when directories in the target are missing 2013-04-01 06:47:44 +00:00
Arvid Norberg 431efc6157 merge storage fix from RC_0_16 2013-03-03 04:47:19 +00:00
Arvid Norberg a0caa0f4b2 disable invariant_check functions when invariant checks are disabled 2013-02-25 04:13:46 +00:00
Arvid Norberg 3599b130c0 expand unit tests 2013-02-24 10:02:26 +00:00
Arvid Norberg e45c71dd30 merged sparse file fix from RC_0_16 2013-02-16 08:26:55 +00:00
Arvid Norberg d63b82bb78 merged rename_file fix from RC_0_16 2013-02-09 21:50:22 +00:00
Arvid Norberg 0977848cca optimize file lookups in storage 2013-01-21 02:46:42 +00:00
Arvid Norberg f1b8582a95 add gen_todo.py script. include todo.html and mark up some todos in the code with priority 2013-01-20 23:21:53 +00:00
Arvid Norberg 38d7e58177 merge checking fix from RC_0_16 2013-01-06 04:53:26 +00:00
Arvid Norberg 6d7e9e4521 remove some iostream dependencies 2012-10-12 04:50:34 +00:00
Arvid Norberg 3bf462f858 merged resume data fix from RC_0_16 2012-10-07 20:25:15 +00:00
Arvid Norberg bff648a89e update copyright dates and add tool to do so 2012-10-02 03:16:33 +00:00
Arvid Norberg f403b5f3c8 fix move_storage bugs 2012-06-29 23:35:11 +00:00
Arvid Norberg bc851d317f work on test_web_seed 2012-03-22 01:48:17 +00:00
Arvid Norberg 4d49d0f20d windows storage fixes 2011-11-13 04:12:56 +00:00
Arvid Norberg 2d6d76c525 fix mistake in last disk I/O patch 2011-11-03 09:19:43 +00:00
Arvid Norberg 1d238fd1d8 ignore EOF error from readv() in unaligned_write 2011-11-03 04:56:24 +00:00
Arvid Norberg ca9122861a merged unaligned write fix over from RC_0_15 2011-11-02 04:45:22 +00:00
Arvid Norberg e6324670a1 fix issue in write_unaligned when writing to a file it's too short 2011-10-11 08:43:15 +00:00
Arvid Norberg bc1e47a486 solaris fixes 2011-09-04 23:29:47 +00:00
Arvid Norberg 51ed06304e deprecated compact storage allocation 2011-08-22 00:51:14 +00:00
Arvid Norberg e81dbfb7f8 don't create all directories up front when adding torrents 2011-08-01 00:22:54 +00:00
Arvid Norberg 40fb16b703 fix for pad-files 2011-07-12 08:53:20 +00:00
Arvid Norberg 639590eff8 fixed typo in physical_offset pad-file fix 2011-07-03 21:09:42 +00:00
Arvid Norberg 2c07e488b1 fix assert in storage::physical_offset when peers requests pad files 2011-07-03 15:57:41 +00:00