Commit Graph

4296 Commits

Author SHA1 Message Date
arvidn 7bfbeba947 plugin documentation update 2017-12-30 00:24:21 +01:00
arvidn c8bf782bd0 bump version number to 1.1.6 2017-12-29 15:53:51 +01:00
arvidn 00a36608b9 fix some typos 2017-12-29 02:29:42 +01:00
arvidn 8b3624b25b remove_peer() and attach_peer() error handling 2017-12-28 14:26:19 +01:00
arvidn aae12250ae support forced shutdown/destruction of torrent objects 2017-12-28 14:11:55 +01:00
arvidn 5f0c9a0c1d improve error handling during session shutdown 2017-12-28 13:52:07 +01:00
arvidn c3bdc6f825 use an intrusive linked list for peer_cache_entry instead an unordered set, to avoid heap allocations and make cache operations not able to fail. This simplifies error handling 2017-12-28 00:52:09 +01:00
arvidn a9753d3bdc merge RC_1_1 into master 2017-12-27 22:16:14 +01:00
arvidn c1abafc0cc reserve space in the undead peers list up-front, to not have to allocate memory when disconnecting 2017-12-27 21:24:16 +01:00
arvidn 69ff30f50f deprecate save_encryption_settings (they are part of the normal settings) 2017-12-27 13:39:36 +01:00
arvidn 347555ea8f handle errors in peer_connection 2017-12-26 10:39:54 +01:00
arvidn 56ca5fa63c support asio handler allocators in deferred_handler 2017-12-26 09:44:51 +01:00
arvidn 40292a1d51 don't heap-allocate handlers for incoming UDP packets 2017-12-24 11:22:30 +01:00
arvidn 753826cbb8 merger RC_1_1 into master 2017-12-23 18:15:01 +01:00
arvidn 62bf524e75 disable DHT logging with the TORRENT_DISABLE_LOGGING macros as well 2017-12-23 12:01:18 +01:00
arvidn b7decd452e add getters for peer_class_filter and peer_class_type_filter 2017-12-23 09:25:06 +01:00
arvidn a54f76d5df deprecate status_code from tracker_error_alert (it's already part of the error_code), simplify code a bit 2017-12-19 00:55:51 +01:00
arvidn d45de18ba7 merged RC_1_1 into master 2017-12-18 23:01:33 +01:00
arvidn 178281e1c5 make torrent_handler::set_priority() to use peer_classes 2017-12-18 00:56:44 +01:00
arvidn 87de08cb3d improve type safety of plugin interface 2017-12-17 23:55:12 +01:00
arvidn bb945f5cf4 introduce a proper type for pex flags to improve type-safety 2017-12-17 23:17:12 +01:00
arvidn 55babc57e6 merged RC_1_1 into master 2017-12-15 17:18:27 +01:00
arvidn d1a63cd781 fix build against boost-1.66, specifically the boost.asio changes 2017-12-15 11:29:53 +01:00
arvidn ba224a1577 restore the parse_magnet_uri overload that amends an add_torrent_params object 2017-12-14 12:20:02 +01:00
Steven Siloti 9e0a3aead1 use info hash from params instead of passing it separately 2017-12-14 10:18:33 +01:00
arvidn 7b06a5ee6e merged RC_1_1 into master 2017-12-13 12:36:35 +01:00
arvidn b00b3184c0 some minor i2p cleanups 2017-12-08 09:57:21 +01:00
arvidn c4cf7ebae6 Merge branch 'master' of https://github.com/arvidn/libtorrent 2017-12-07 18:31:26 +01:00
arvidn 90ccd5180f merged RC_1_1 into master 2017-12-07 18:31:16 +01:00
Alden Torres db61d9cc20 minor cleanup, refactor and typos (#2593) 2017-12-07 07:51:55 +01:00
arvidn f81a20a035 fix loading resume data when in seed mode 2017-12-03 23:43:55 +01:00
arvidn c16eb32b94 merge RC_1_1 into master 2017-12-03 18:12:35 +01:00
arvidn 4b467f82ac fix issue with initializing settings on session construction 2017-12-02 12:20:36 +01:00
arvidn 5ce798197c merged RC_1_1 into master 2017-12-02 11:39:23 +01:00
Alden Torres 163d13e1d2 implemented support magnet URI extension, select specific file indices for download, BEP53 (#2578) 2017-12-01 12:40:19 +01:00
Alden Torres 28f096e94e added const to static arrays, minor refactor in alert.cpp 2017-12-01 09:57:00 +01:00
arvidn f42b63c7ea update io_service forward declaration to be boost-1.66 compatible 2017-11-29 17:58:20 +01:00
arvidn a6656aeb93 generate random keys for use in tracker announces. keys are unique for each torrent and the listen interface they announce via 2017-11-29 00:10:35 +01:00
arvidn 0da2d4dca3 make sure libtorrent_assert_log is exported, when production asserts are enabled 2017-11-28 09:46:18 +01:00
Alden Torres f2681412e7 more use of const in peer_connection.cpp and minor code refactor 2017-11-28 09:45:40 +01:00
arvidn 18176ae5b3 include peer_class_type_filter in the generated reference documentation 2017-11-24 23:40:51 +01:00
arvidn 4e452c7bb6 improve peer class documentation 2017-11-24 15:33:52 +01:00
arvidn addc52706e fix typo 2017-11-23 20:53:54 +01:00
arvidn 4bc93cff38 merge RC_1_1 into master 2017-11-23 18:01:32 +01:00
arvidn 5e7666526e fix IPv6 tracker announce issue 2017-11-23 10:11:59 +01:00
Alden Torres c97bd53cde more use of const, emplace_back and minor code refactor 2017-11-20 23:45:41 +01:00
Arvid Norberg c734f42ac3
make tracker announces happen even if there are no open listen sockets (#2529)
support announcing to IPv6 trackers and running an IPv6 DHT when not listening for incoming connections
2017-11-20 23:42:22 +01:00
arvidn 30a7b52855 use a proper optional value instead of a sentiel value for bytes_left() 2017-11-19 21:25:06 +01:00
arvidn f262bbdcea use seconds32 as the retry-time for web seeds 2017-11-19 16:20:36 +01:00
arvidn 237856f7f1 more fixes of unwanted macro expansions of min/max in headers (windows.h compatibility) 2017-11-13 15:36:42 +01:00
arvidn 521587c026 make sure the cork destructor doesn't leak exceptions 2017-11-12 23:03:54 +01:00
arvidn 0378ae47f4 fix some macro expansions of 'max' in headers, to improve compatibility with windows.h 2017-11-12 23:01:47 +01:00
arvidn b6a73eeaaa simplify trigger_unchoke and trigger_optimistic_unchoke on session_impl, abd make them noexcept 2017-11-12 15:48:46 +01:00
arvidn 94dcd8e14b remove unused transaction id member of DHT observers 2017-11-12 15:46:33 +01:00
arvidn 1c278cc697 add API to query whether alerts have been dropped or not 2017-11-11 15:42:53 +01:00
arvidn 254f813626 factor out handler allocator and reuse it for posting deferred peer removals on torrents 2017-11-11 10:41:39 +01:00
arvidn b88c193742 fix sign conversion warning in peer_class_type_filter 2017-11-11 09:17:37 +01:00
Pavel Pimenov 8ac6bbe553 add http_parser::header_int (#2472) 2017-11-09 23:43:26 +01:00
arvidn fc74c032f0 minor cleanup and modernization of torrent_peer 2017-11-09 15:48:27 +01:00
arvidn f41d2b5d3b move shared_ptr instead of copying them, when constructing DHT observers 2017-11-08 23:09:43 +01:00
arvidn 7730eea401 restore backwards compatibility with the API before download_priority_t was introduced 2017-11-06 01:24:24 +01:00
arvidn a690e6c76d add throwing overload of parse_magnet_uri 2017-11-05 20:31:06 +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
arvidn f57b90b500 introduce type for torrent queue_position 2017-11-01 10:52:45 +01:00
Alden Torres 5480c08184 enable/disable the internal ip notifier with new setting (#2487) 2017-11-01 10:51:51 +01:00
Johan Gunnarsson 03b3d24ccf Install kademlia/dht_settings.hpp with Automake 2017-10-29 02:48:36 +02:00
Alden Torres f040d6d860 added reopen_network_sockets method to allow manual reopen of listen/outgoing sockets (#2476) 2017-10-28 12:15:35 +02:00
arvidn 50bef25786 make the piece-picker less two-phase initialized 2017-10-26 23:39:15 +02:00
Alden Torres ab4f140328 using NETLINK_NO_ENOBUFS to ignore ENOBUFS in netlink based ip notifier (#2475) 2017-10-26 11:15:19 +02:00
arvidn 80ac90727b remove some questionable code from disk_io_thread when deleting files for a torrent and extend transfer test to cover deleting files while seeding 2017-10-25 19:00:54 +02:00
arvidn 9e69bf3618 introduce a type to refer to a torrent-list-index, to improve type safety 2017-10-25 13:39:37 +02:00
Alden Torres b380bf8059 minor and general code cleanup/refactor 2017-10-25 09:58:47 +02:00
Alden Torres 6409cb42e1 fix implicit-fallthrough warnings with gcc 7 2017-10-23 19:18:33 +02:00
Alden Torres bb409c5ee9 missing return if error in session_impl::on_port_mapping, doc typo (#2459) 2017-10-23 12:36:51 +02:00
arvidn 98effc8d88 minor disk_io_job piece_hash cleanup 2017-10-22 16:49:25 +02:00
Alden Torres 8083a6c2bd some code indentation, one more use of nullptr and constexpr 2017-10-15 04:30:10 +02:00
arvidn a6c85496b5 make parse_magnet_uri return the add_torrent_params instead of of taking an in-out parameter 2017-10-15 04:29:53 +02:00
Alden Torres 762ae9aec4 pick standard std::aligned_union if using clang (#2447) 2017-10-15 04:29:33 +02:00
arvidn 516df740a3 make session_handle::get_torrent_status return the vector instead of taking an out-parameter 2017-10-14 23:35:35 +02:00
arvidn bb65acb082 make feature_flags proper type-safe 2017-10-14 23:33:48 +02:00
arvidn f0bac4cac7 merged RC_1_1 into master 2017-10-14 15:22:22 +02:00
arvidn 6214103619 fix documentation typo 2017-10-14 13:54:43 +02:00
arvidn 8adcfdbf41 make disk_buffer_holder know the size of the bufer it holds, to fix buffer overrun in chained_buffer
fix
2017-10-13 21:07:31 +02:00
arvidn 4556fe5566 fix outdated comment 2017-10-13 16:27:21 +02:00
arvidn 8af89da689 fix GCC-4.9 build 2017-10-13 10:08:51 +02:00
arvidn 9111d5977e make the variables holding the source of external IPs type-safe 2017-10-10 22:38:36 +02:00
Arvid Norberg 60b74d2616 merged RC_1_1 into master 2017-10-10 14:25:12 +02:00
Arvid Norberg 830ef0bedd prevent dependency on openssl from leaking outside of libtorrent (libssl and libcrypto should not be a usage requirement). This cleans up most tests to build without having to also link against openssl 2017-10-09 17:15:35 +02:00
Arvid Norberg aec9a4940c fix peer_list constructor 2017-10-08 22:06:43 +02:00
arvidn 1d15e6bfb4 merge RC_1_1 into master 2017-10-08 18:21:25 +02:00
arvidn cdd9f91999 fix leak of torrent_peer objecs (entries in peer_list) 2017-10-07 11:43:42 +02:00
arvidn d0f55224fb simplify copy_ptr 2017-10-07 02:59:46 +02:00
Alden Torres e47f73ee3b cleanup of field torrent_need_cert_alert::error (#2414)
deprecate field torrent_need_cert_alert::error
2017-10-06 10:54:33 +02:00
arvidn ed31664ee3 deduce the second argument to iconv() instead of requiring it to be configured via a macro 2017-10-06 10:52:09 +02:00
Matthew Fioravante 170c2a6984 Fixes to copy_ptr
* Add move constructor
* Add move assignment
* Fix exception safety bug in copy assignment
2017-10-05 11:44:27 +02:00
arvidn 69dc73914a merged RC_1_1 into master 2017-10-04 11:43:01 +02:00
Tim Niederhausen 7f033fa04b Fix malloc result size detection on FreeBSD
Instead of <malloc/malloc.h> and malloc_size FreeBSD has <malloc_np.h> and
malloc_usable_size.

see: https://www.freebsd.org/cgi/man.cgi?query=malloc_usable_size&manpath=FreeBSD+11.1-RELEASE+and+Ports
2017-10-04 08:56:55 +02:00
arvidn 5f3661aaa2 back port overflow checking from master 2017-10-02 00:02:14 +02:00
arvidn 5026659cb6 clean up and fix edge cases in update_path_index 2017-10-01 04:43:41 +02:00
arvidn 68f05d6380 fix some warnings and integer overflow with torrents that are too big 2017-09-28 14:59:28 -07:00
arvidn c66f4cc62a fix some warnings, mostly 0 -> nullptr 2017-09-28 07:33:10 -07:00
Alden Torres 53ab7684fd minor code refactor and cleanup in port mapping code 2017-09-28 01:17:21 -07:00
arvidn d0067eafe0 fix typo 2017-09-26 09:21:30 -07:00
arvidn 9cad0d8cf2 expose peer class API in python binding 2017-09-24 23:25:20 -07:00
arvidn edad33d270 fix const correctness in get_peer_class 2017-09-24 14:49:55 -07:00
arvidn 4c4c630fae merge RC_1_1 into master 2017-09-23 10:46:29 -07:00
arvidn d22c44c057 fix kludge and down-cast to send upload_only. Promote upload-only to a top-level peer feature 2017-09-23 07:51:51 -07:00
Alden Torres 1d9b10a32b fix warning for Xcode 9, added const and minor code refactor to bt_peer_connection.cpp 2017-09-22 04:46:16 -07:00
Steven Siloti 8648de3706 DHT nodes should only handle requests on their socket (#2355) 2017-09-21 21:00:38 -07:00
arvidn 7f4566c694 improve share_ratio_limit documentation 2017-09-21 13:05:23 -07:00
arvidn fc4588ad3b bump priority of storage_moved_alert and storage_moved_failed_alert 2017-09-21 05:43:18 +02:00
arvidn 6b55096ebd switch some using declarations to new-style typedefs. remove some redundant parenthesis 2017-09-18 09:38:51 +02:00
arvidn 7717c02c2f run sonarqube with deprecated functions disabled. fix some of its code smells 2017-09-17 18:06:53 +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 240b5f73b1 merged RC_1_1 into master 2017-09-16 21:07:29 +02:00
arvidn 1a8660bca7 don't shadow static_category in alerts 2017-09-16 19:58:11 +02:00
arvidn 1ddc710be1 fix uTP path MTU discovery issue on windows (DF bit was not set correctly) 2017-09-16 19:56:42 +02:00
arvidn 8d6b51d54c minor cleanups 2017-09-16 13:48:11 +02:00
arvidn 17d5d34272 fix documemtation of storage_moved_alert 2017-09-16 12:35:35 +02:00
arvidn 93bb84d94c some random cleanup 2017-09-13 08:28:46 +02:00
arvidn ccbd6cbcfe remove rss_reader.py, since rss has been reprecated. fix python binding for torrent_handle, to be hashable. update client_test.py to not use deprecated APIs and follow best (libtorrent) practice 2017-09-11 22:28:57 +02:00
arvidn 735f6fd1f4 remove redundant virtual specificers when override is present 2017-09-10 19:28:18 +02:00
Steven Siloti df8a57efb7 select which DHT port to report based on the connection's local endpoint (#2316) 2017-09-10 10:25:04 +02:00
arvidn 55228756e5 make disk job flags type safe 2017-09-10 08:56:52 +02:00
arvidn bb51dcdbb9 move dht_settings into its own header cpp file-pair and dht_settings into the dht namespace 2017-09-04 22:38:16 +02:00
arvidn 95c8c3018a use span in gzip, http_parser and http_connection 2017-09-04 22:33:38 +02:00
arvidn 3da7d1d3da fix documentation issue 2017-09-04 16:50:11 +02:00
arvidn 061732ddec bump version 2017-09-04 15:35:45 +02:00
arvidn 53ff169db1 use string_view in find_metric_idx 2017-09-04 07:50:13 +02:00
arvidn fe1c395579 merged RC_1_1 into master 2017-09-03 13:57:19 +02:00
arvidn 37ffe99a19 fix gen_fwd.py to correctly put declarations in the dht namespace that belong there 2017-09-03 12:28:34 +02:00
Steven Siloti 5361ffc1c2 add_file_borrow: use string_view instead of pointer, size parameters (#2302) 2017-09-02 23:58:36 +02:00
arvidn 7087a16b36 move some initialization of torrent from start() into the constructor 2017-09-02 21:24:00 +02:00
arvidn 2025c15ec1 cleanup tokenize_string -> split_string 2017-09-02 07:46:16 +02:00
arvidn f8ba4f480f use span in parse_utf8_codepoint 2017-09-02 07:03:46 +02:00
arvidn 11f008e90e use a strong typedef for port mapping id 2017-09-02 07:02:07 +02:00
Steven Siloti f022285b13 include endpoint in tracker alerts 2017-09-01 13:38:36 +02:00
Arvid Norberg f734ad067b straighten out some type-safety in port mapping enums (#2285) 2017-08-30 20:47:49 +02:00
Alden Torres 5db597c8b3 more use of std::tuple_size<> and empty() 2017-08-28 22:47:34 +02:00
Arvid Norberg 1075ae3b8d remove session pool allocator and use the buffer class instead (#2274)
simplify append_buffer by using size() to determine size of the buffer. make the move explicit in chained_buffer::init_buffer_entry
2017-08-28 11:37:53 +02:00
Steven Siloti cc3f73de96 add span ctor from const containers (#2275) 2017-08-28 11:36:51 +02:00
Arvid Norberg d250ba5a17 wrap destination string in i2p_peer in string_ptr handler (#2268) 2017-08-25 09:42:46 +02:00
arvidn e92cbf502c remove the last use of session_impl get_ipv6_interface and get_ipv4_interface 2017-08-23 21:01:15 +02:00
arvidn 22c047f8a0 factor out and simplify get_syncoffset 2017-08-23 06:59:44 +02:00
arvidn f311bf354e remove left-overs from disk buffer pool allocator 2017-08-21 16:36:00 +02:00
Alden Torres 66734e2e5b using if_indextoname instead of RTM_GETLINK to fill the interface name in enum_net_interfaces (#2253)
using if_indextoname instead of RTM_GETLINK to fill the interface name in enum_net_interfaces. removed IFA_LABEL switch case, removed ip_interface::mtu, master rebase
2017-08-20 10:55:59 +02:00
arvidn fe37884bc6 fix IPv6 tracker support by performing the second announce in more cases 2017-08-19 18:56:51 +02:00
Steven Siloti 2365611507 remove support for using a pool allocator for disk buffers (#2257) 2017-08-19 11:04:39 +02:00
arvidn 05b5b4ef4d merged RC_1_1 into master 2017-08-16 22:46:47 +02:00
arvidn b70d3efba9 fix infinite loop when parsing torrents whose filenames have zeroes. #2247 2017-08-16 07:21:34 +02:00
Alden Torres bde4718e3f typos, auto loop refactor and more std:: 2017-08-16 07:01:50 +02:00
arvidn b03b7417dd build boost from scratch on linux (to get a newer version). upgrade travis to trusty and newer xcode. python binding fixes 2017-08-14 12:22:06 +02:00
Alden Torres 48de05ba82 lint-based code review in utp related code 2017-08-13 07:49:43 +02:00
arvidn 865ff09a84 merge RC_1_1 into master 2017-08-10 16:44:57 +02:00
arvidn 4e497e1383 fix issue where paths were not correctly coalesced when adding files to file_storage (used more memory than necessary) 2017-08-10 12:10:46 +02:00
arvidn dbea43ab35 fix typo in comment 2017-08-10 07:59:16 +02:00
arvidn bb6f2b9837 extend file_storage tests. Make pad files separate paths and file names properly 2017-08-10 01:33:35 +02:00
Alden Torres 721c4d016a more use of emplace_back in write_resume_data (#2221) 2017-08-09 00:19:11 +02:00
Alden Torres 8ed17ab311 minor code refactor, more use of nullptr, typos 2017-08-07 21:15:14 +02:00
Alden Torres 0b83b6b6df fix typo and extra ::alert 2017-08-06 04:28:36 +02:00
arvidn 7b98af8145 improve type-safety of observer_flags and traversal_flags 2017-08-05 20:20:13 +02:00
Alden Torres 1e05a91f99 added some std:: in public api 2017-08-05 02:44:25 +02:00
arvidn 5bf28e37b8 make create_torrent flags type-safe 2017-08-04 21:23:42 +02:00
Alden Torres cb114a80e1 reverted ino_t cast and added fix only for android 2017-08-04 21:22:20 +02:00
arvidn 6b1037eff5 convert enum values that are just used as constants, to actual constants with the correct type 2017-08-04 15:23:20 +02:00
arvidn a8a5986046 make file attributes (in file_storage) type safe 2017-08-04 07:38:57 +02:00
Alden Torres ae0baff5a3 using status_flags_t::all() in post_torrent_updates, minor typos 2017-08-04 01:51:52 +02:00
arvidn 6fa181ece8 some cleanup of type-safe flags 2017-07-30 18:20:15 -07:00
arvidn 322007bb6a make save_state_flags a strong type 2017-07-30 09:06:41 -07:00
arvidn 69bd2986de convert a few more torrent_handle flags to type safe types 2017-07-27 13:16:23 -07:00
arvidn 204a029b5f merged RC_1_1 into master 2017-07-27 11:37:02 -07:00
Johan Gunnarsson 972f179a5c Stop using deprecated save_proxy in header files
Without this patch, compiler will warn about save_proxy being used by merely
including session_handle.hpp:

/tmp/include/libtorrent/session_handle.hpp:104:45: warning: ‘save_proxy’ is deprecated [-Wdeprecated-declarations]
    save_dht_proxy TORRENT_DEPRECATED_ENUM = save_proxy,
                                             ^~~~~~~~~~
/tmp/include/libtorrent/session_handle.hpp:102:4: note: declared here
    save_proxy TORRENT_DEPRECATED_ENUM =        0x008,
    ^~~~~~~~~~
/tmp/include/libtorrent/session_handle.hpp:105:46: warning: ‘save_proxy’ is deprecated [-Wdeprecated-declarations]
    save_peer_proxy TORRENT_DEPRECATED_ENUM = save_proxy,
                                              ^~~~~~~~~~
/tmp/include/libtorrent/session_handle.hpp:102:4: note: declared here
    save_proxy TORRENT_DEPRECATED_ENUM =        0x008,
    ^~~~~~~~~~
/tmp/include/libtorrent/session_handle.hpp:106:45: warning: ‘save_proxy’ is deprecated [-Wdeprecated-declarations]
    save_web_proxy TORRENT_DEPRECATED_ENUM = save_proxy,
                                             ^~~~~~~~~~
/tmp/include/libtorrent/session_handle.hpp:102:4: note: declared here
    save_proxy TORRENT_DEPRECATED_ENUM =        0x008,
    ^~~~~~~~~~
/tmp/include/libtorrent/session_handle.hpp:107:49: warning: ‘save_proxy’ is deprecated [-Wdeprecated-declarations]
    save_tracker_proxy TORRENT_DEPRECATED_ENUM = save_proxy
                                                 ^~~~~~~~~~
/tmp/include/libtorrent/session_handle.hpp:102:4: note: declared here
    save_proxy TORRENT_DEPRECATED_ENUM =        0x008,
    ^~~~~~~~~~
2017-07-27 11:31:39 -07:00
arvidn 24e4263bae make torrent status flags be type safe 2017-07-27 09:33:35 -07:00
arvidn 5222d92e9f make resume_data_flags type safe 2017-07-27 00:07:15 -07:00
arvidn 8d0f38930e make udp send flags type safe 2017-07-26 18:09:17 -07:00
arvidn 83ca755d1b simplify setup_listener 2017-07-26 12:02:58 -07:00
arvidn cd343c91bc make base32encode flags type safe 2017-07-26 10:38:14 -07:00
arvidn b38efb6c65 make alert category flags be a strong type 2017-07-26 07:20:47 -07:00
arvidn c167e28788 move stack allocator implementation into its own cpp file 2017-07-23 16:49:24 -07:00
arvidn 330904f460 convert picker_flags_t to type safe flags 2017-07-23 09:29:25 -07:00
arvidn 78bbd298a5 convert file_open_mode to type safe flags 2017-07-22 23:58:24 -07:00
Steven Siloti 140b8ace8d remove use of deprecated function readdir_r 2017-07-22 22:40:17 -07:00
arvidn c4eb4c8b5f use span in torrent_info constructors and deprecate the redundant flags argument 2017-07-22 00:00:44 -07:00
Steven Siloti 5eba09fce7 changes based on review feedback 2017-07-21 19:18:44 -07:00
Steven Siloti 1a64490ef0 fix 2017-07-21 19:18:44 -07:00
Steven Siloti f0ae2145ea use a handle class for listen sockets instead of raw pointers
Listen socket handles need to be week_ptr so that they can detect when a listen
socket is removed in the middle of a tracker announce on it. Use a wrapper class
to enforce that no one outside of session_impl can hold ownership of the socket
across event boundaries.

To support unit tests, listen_socket_t is also split into a base class which
holds the members needed to support the public listen socket API.
2017-07-21 19:18:44 -07:00
Steven Siloti e0dcd34352 convert m_listen_sockets to a vector of shared_ptr 2017-07-21 19:18:43 -07:00
Steven Siloti 0f30815d8f Revert "don't move listen_socket_t when deleting sockets"
This reverts commit 718c5f0dcb.
2017-07-21 19:18:43 -07:00
Johan Gunnarsson 7a95947bac Add torrent_flags.hpp to Makefile.am 2017-07-21 15:46:48 -07:00
arvidn 33a2abebfe submit disk jobs in read_piece() 2017-07-18 07:21:07 -07:00
arvidn 3ce15b36d1 fix some c++11 parsing issues in reference doc generation script 2017-07-17 22:01:54 -07:00
arvidn f9c45db942 make bandwidth state flags use type-safe flags 2017-07-17 19:03:42 -07:00
arvidn 06070ea499 convert block request flags to type-safe flags 2017-07-17 17:56:07 -07:00
arvidn c4659bc345 convert peer_flags and peer_source_flags to type-safe flags 2017-07-17 10:22:32 -07:00
arvidn 4947602a2f make add_torrent_params::flags_t an enum class and move it out into its own header 2017-07-17 01:05:31 -07:00
AllSeeingEyeTolledEweSew 00655d562b Refactor several flags to torrent_handle::get_flags/set_flags. 2017-07-17 01:05:31 -07:00
arvidn 73942de97a carve out peer_list_entry into also being deprecated (it was only used by deprecated functions and some tests) 2017-07-16 19:20:29 -07:00
toinetoine b1c3e12cd0 added block_uploaded_alert to allow client to track upload activity 2017-07-16 11:04:03 -07:00
arvidn d32341b986 slight improvements to the bitfield_flag type 2017-07-16 09:50:48 -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 c692147c94 merged RC_1_1 into master 2017-07-13 19:55:29 -07:00
arvidn cc30434c52 fix inconsistency in file_priorities and override_resume_data behavior. file_priorities are not subject to the override_resume_data flag 2017-07-12 15:36:55 -07:00
arvidn 7eb3cf6bc6 use the official boost.config header 2017-07-12 11:31:29 -07:00
d-komarov 85cf521145 fix bandwith rate limit calculation (#2134)
back-port of fc0cbfb789
2017-07-11 21:35:12 -07:00
Steven Siloti 2e79c5e648 fix handling of SSL listen sockets 2017-07-10 21:41:39 -07:00
d-komarov 11d6a00bec fix storage destruction order issue (#2138)
back-ported from b553cb32f7
2017-07-10 21:35:34 -07:00
Steven Siloti 389b4eb3f2 make listen_socket_t non-copyable and non-movable (#2137)
The DHT stores a pointer to this struct so it must not be copied or moved once
it is stored in m_listen_sockets.
2017-07-10 10:14:36 -07:00
Steven Siloti 718c5f0dcb don't move listen_socket_t when deleting sockets
Pointers to listen_socket_t are stored in dht_tracker, so they
cannot be copied or moved once they are added to m_listen_sockets.

listen_socket_t should really be made non-copyable and non-moveable, but the
socket creation path needs to be refactored before that can be done.
2017-07-08 08:42:04 -07:00
Alden Torres 80036f0377 avoid executing timed async task if the dht node is already removed (#2133) 2017-07-08 08:32:24 -07:00
Steven Siloti ec2fb91aa5 reject put messages with incorrect bencoding (#2118)
add function to check for soft bdecode errors. reject put messages with incorrect bencoding
2017-07-02 18:30:32 -04:00
arvidn 5188c190db bump version number 2017-07-02 15:03:46 -04: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 dc76f8a769 start a document of changes from 1.1 to 1.2 2017-06-30 08:29:47 -04:00
arvidn 20c1407612 corrected missing const qualifiers on bdecode_node 2017-06-30 08:19:10 -04:00
arvidn 3c8450d47c fix backwards compatibility issue when loading the torrent info dict from resume data 2017-06-29 15:03:49 -04:00
Steven Siloti bbf361336b Use netlink to enumerate network interfaces on linux (#2105)
* move getting a table dump over netlink to a separate function
* use netlink to enumerate network interfaces on linux
2017-06-27 00:34:24 -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 2af4e936c4 fix master build 2017-06-21 13:03:36 -04:00
arvidn f85c01cc0a merged RC_1_1 into master 2017-06-21 00:51:43 -04:00
Alden Torres 687e0ea4b4 added consts and minor auto refactor in upnp.cpp 2017-06-20 17:59:05 -04:00
arvidn aa842948a3 storage_params cleanup 2017-06-20 10:27:28 -04:00
arvidn 046bb76361 handle invalid arguments to set_piece_deadline() 2017-06-19 05:46:08 -04:00
arvidn 35491bc476 convert remaining alerts to use operation_t instead of string literal 2017-06-18 22:05:50 -04:00
arvidn f04d729d43 enforce spell checking on CI 2017-06-18 15:51:51 -04:00
arvidn ff454a92d4 unify some operation-enums and strings to use operation_t 2017-06-18 07:31:45 -04:00
arvidn 53cbb607d0 first steps towards spell checking documentation 2017-06-17 22:59:57 -04:00
arvidn ff8703e862 make alert types ABI compatible between builds with deprecated members enabled and without 2017-06-17 16:07:06 -04:00
arvidn 1fd350cf60 make operation_t an enum class, for type safety 2017-06-15 07:00:06 -04:00
arvidn 3215deb2c5 make io_service::work accounting more accurate in asio-debugging=on 2017-06-14 07:01:06 -04:00
arvidn 9a19ff344b remove resolve_links disk job left-overs and convert some C-arrays to std::array 2017-06-13 20:35:55 -04:00
Alden Torres 48ef3b6bf7 implemented support for BEP 51 (#1652) 2017-06-12 11:54:11 +02:00
arvidn 147d996160 make the job action enum an enum class 2017-06-11 23:53:58 +02:00
Pavel Pimenov de369451b1 fix operator() ==, add const (#2063) 2017-06-10 08:18:32 +02:00
arvidn f3d319b677 fix internal use of deprecated function identify_client 2017-06-10 08:16:23 +02:00
Andrei Kurushin fc0cbfb789 fix bandwith rate limit calculation (#2060) 2017-06-08 12:50:55 +02:00
arvidn 4de9f6a75b remove requester parameter to disk read jobs 2017-06-08 12:38:25 +02:00
arvidn 700befc98a fix for what appears to be an clang/llvm miscompilation 2017-06-07 22:35:35 +02:00
Alden Torres e38887cb3c added add_torrent_params.cpp and moved is_nothrow asserts to cpp files (#2059) 2017-06-07 16:41:28 +02:00
Alden Torres ea851e955e avoid netlink.hpp compilation errors due to lack of comparison operators for sockaddr_nl 2017-06-02 20:36:59 +02:00
arvidn 5e384ccce3 more typed_span conversion fixes 2017-06-02 17:32:27 +02:00
Alden Torres b1b3f0e3e8 one more fix related to typed_span conversion (#2050) 2017-06-02 06:42:03 +02:00
arvidn 6967d17a42 make move constructors and move assignment operators noexcept 2017-06-01 23:42:15 +02:00
arvidn 48bb1d2c95 fix default value for move_storage 2017-06-01 23:08:14 +02:00
Arvid Norberg 5344761da4 make flags to move_storage a proper enum class (#2043) 2017-06-01 04:15:15 -04:00
Alden Torres c5cdd381da fixed compilation warnings with newer versions of clang (#2047) 2017-06-01 04:12:02 -04:00
Pavel Pimenov d0ff2200f9 torrent::remove_connection refactor (#2046) 2017-05-31 21:59:16 -04:00
Steven Siloti 67a530f3ab only listen on preferred IPv6 addresses on Windows
We shouldn't listen on addresses which are duplicates, deprecated,
or tenative unless explicitly requested.

This is only supported on Windows for now because the Linux interface
to get this information is much less convenient for libtorrent to use.
As far as I've been able to determine, Linux only exposes this information
via the RTM_NEWADDR and RTM_GETADDR netlink messages. Currently libtorrent
uses getifaddrs() to enumerate network interfaces on Linux so this will
probably need to be changed to use netlink if available.

MacOS: ???
2017-05-30 07:38:12 -04:00
arvidn afce0d3a86 make resolver_flags use enum class for improved type-safety 2017-05-29 18:38:59 -04:00
Pavel Pimenov 98a0344196 refactor traversal_algorithm look_for_nodes (#1982) 2017-05-29 12:20:52 -04:00