Commit Graph

628 Commits

Author SHA1 Message Date
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -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 cec874591d moved ip_notifier.hpp to aux_ 2017-04-05 20:37:32 -04:00
Alden Torres 65cf7af722 using unique_ptr for m_ip_notifier in session_impl 2017-04-05 17:43:12 -04:00
arvidn 9e5822dfba remove unused m_tick_residual accounting 2017-04-05 01:35:39 -04:00
Alden Torres 45bea967c2 added resolver_cache_timeout setting (#1878)
added resolver_cache_timeout setting
2017-04-04 18:23:37 -04:00
pavel.pimenov 6afb0fd51b fix m_host_resolver (for RC_1_1) 2017-03-31 07:29:03 -04:00
Alden Torres 990756ca38 code cleanup related to async_resolve (#1873) 2017-03-30 23:00:59 -04:00
arvidn d720b282b8 Merge branch 'master' of https://github.com/arvidn/libtorrent 2017-03-30 18:14:09 -04:00
arvidn 0b6fe4d0bd merged RC_1_1 into master 2017-03-30 18:07:24 -04:00
Pavel Pimenov 923f2c48fc fix m_host_resolver (#1871)
fix initialization order of m_host_resolver and m_tracker_manager
2017-03-30 08:47:41 -04:00
arvidn 02bb1251d2 removed (broken) support for incoming connections over socks5 2017-03-29 02:15:43 -04:00
arvidn 6cdd598e7c make add_torrent_params movable and have add_torrent/async_add_torrent take it by value 2017-03-26 16:48:57 -04:00
Arvid Norberg 103b1176c1 remove torrent_file_path asynchronous loading of .torrent files. (#1848)
remove torrent_file_path asynchronous loading of .torrent files. This is not the responsibility of the client, to simplify and unify the path of adding torrents
2017-03-26 09:16:42 -04:00
arvidn 7640c0641e optimize download queue management with an explicit queue 2017-03-25 20:47:33 -04:00
Alden Torres fcbcc250bb fix setup of DHT logic in session_impl::init (#1830)
fix setup of DHT logic in session_impl::init
2017-03-23 08:32:56 -04:00
arvidn 64f5567cdd merged RC_1_1 into master 2017-03-19 12:58:55 -04:00
arvidn 17bc05c582 improve stats counter documentation 2017-03-18 08:22:24 -04:00
arvidn 6d54c20adf merge RC_1_1 into master 2017-03-08 18:01:59 -05:00
Arvid Norberg 7d3a8f5b19 don't remove peers from the connection list immediately when disconnecting (#1782)
don't remove peers from the connection list immediately when disconnecting them, but defer it until later. This makes it less error prone to disconnect peers in loops over the connections
2017-03-07 13:50:03 -05:00
arvidn faa2029f8b add feature to periodically close files (to make windows clear disk cache) 2017-03-06 23:46:47 -05:00
Alden Torres 847792854d fixing sign-conversion warnings, part 20 (#1745)
fixing sign-conversion warnings, part 20
2017-02-22 23:28:25 -05:00
Alden Torres ee4d82d166 fix in DHT counters, alert types test, typos, formatting (#1747)
fix in DHT counters, alert types test, typos, formatting
2017-02-22 17:40:14 -05:00
Alden Torres 1e98bf19a5 added support for enumerating the internal DHT live nodes (#1712)
added support for enumerating the internal DHT live nodes
2017-02-18 23:02:23 -05:00
Alden Torres a670871519 fix build from RC_1_1 merge 2017-02-17 19:06:51 -05:00
Alden Torres 4d5ddc90f5 fixing sign-conversion warnings, part 14, minor refactor 2017-02-10 15:27:49 -05:00
Arvid Norberg 9e4045ed42 use 32 bit time points in torrent (#1662)
use 32 bit time points in torrent and add some slack to time point comparisons in python test
2017-02-05 19:18:06 -05:00
Alden Torres 8b98bf2c9d more use of peer_class_t in public API 2017-01-22 14:06:27 -05:00
arvidn 61c057947c add typedefs for shared_ptr and make_shared, to make transition to 1.2 easier 2017-01-21 23:10:33 -05:00
Arvid Norberg 6a701437b6 use strong_typedef for peer_class_t type (#1595)
use strong_typedef for peer_class_t type
2017-01-21 22:40:19 -05:00
Alden Torres 1874a917b0 added std:: prefix, end of file cleanup, formatting, consts 2017-01-14 05:59:26 -05:00
Alden Torres a31ba7972d fixing sign-conversion warnings, part 3 (#1537)
fixing sign-conversion warnings, part 3. making aux::vector index type default to int
2017-01-13 01:55:29 -05:00
arvidn 4ebc344e48 make disk_io_thread responsible for the storage object. torrents refer to it by index 2017-01-01 13:54:39 -05:00
Pavel Pimenov 98cdc3192d Missing member init (#1467)
initialize members of piece_block and use default member initialization.
2016-12-29 06:55:58 -08:00
Arvid Norberg af126fe507 make buffer_allocator_interface an implementation detail of the disk_io_thread (#1463)
make buffer_allocator_interface an implementation detail of the disk_io_thread by using disk_buffer_holder in the disk interface. make chained_buffer use holders instead of free deleter functions and userdata to support putting disk_buffer_holder objects in there. Also make the session buffers be held by holders
2016-12-28 17:47:18 -08:00
arvidn 192ef4962b simplify the buffer_allocator_interface 2016-12-26 08:36:50 -08:00
arvidn 3f612d7e99 cleaning up of left-overs from torrent eviction functionality 2016-12-23 06:06:59 -05:00
arvidn bbfe58d03c fix bind-to-device for UDP sockets 2016-12-10 18:18:54 -05:00
Alden Torres 4142dfe5eb headers and code cleanup in udp_socket code 2016-12-06 22:54:29 -05:00
Steven Siloti b9169609df support separate external ip for each interface (#1383)
support separate external ip for each interface
2016-12-04 15:58:51 -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 06c53a41d1 revisions based on code review
Moved the logic to determine which sockets to keep to a separate function and
add unit tests for it.

Store the port which was originally specified for a listen socket so that we
can match sockets reliably even with port retries.
2016-11-23 01:09:05 -05:00
Steven Siloti babb93fb1e keep old listen sockets if they're still valid
This is to support multi-home. We need to be able to keep track of which socket
a DHT node or UTP connection should use. We also need to generate notifications
when local endpoints come and go so that the DHT tracker knows when to create
or delete nodes. The easiest way to do this is to keep the same socket for as
long as its local endpoint is valid. This way the nodes and connections can
simply reference the socket itself and generating notifications is trivial.
2016-11-23 01:09:05 -05:00
arvidn c9333849e6 deprecate relative times in torrent_status, replaced by std::chrono::time_point 2016-11-12 17:37:10 -05:00
arvidn 9e5a2a7de4 remove unused exceeded_cache_use() function 2016-11-07 13:07:46 -05:00
Steven Siloti e589e342ef reopen listen sockets when the system's IP changes (#1299)
reopen listen sockets when the system's IP changes. Only Linux and Windows supported for now.
2016-11-07 07:40:09 -05:00
Arvid Norberg b61ebca14a moved async-load-torrent feature out of disk-io-thread (#1282)
moved async-load-torrent feature out of disk-io-thread into a generic worker thread
2016-11-02 01:01:04 -04:00
Arvid Norberg 1c2a8fb96e move coalescing of reclaim block from disk_io_thread to session_impl (#1281) 2016-10-31 23:48:30 -04:00
Arvid Norberg 8daa200d11 simplify interaction with disk_io_thread by removing the uncork interface (#1271)
simplify the interaction with the disk_io_thread by removing the uncork interface. This should be turned into a transparent part of peer_connection instead and remove cork logic from peer_connection
2016-10-30 18:21:07 -04:00
Arvid Norberg 675d16a2c3 remove remainder of eviction/ghost torrent feature (#1251)
remove remainder of eviction/ghost torrent feature
2016-10-25 08:02:34 -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 20f65946f2 make single-argument constructors explicit (#1194)
make single-argument constructors explicit
2016-10-08 14:07:11 -04:00
Arvid Norberg 5c361715da handle exceptions in session and torrent io_service jobs (#1185)
handle exceptions in session and torrent io_service jobs
2016-10-06 00:08:14 -04:00
Alden Torres 331a8d53c0 refactor to use move with dht_state (#1163)
refactor to use move with dht_state
2016-09-29 08:25:51 -04:00
Alden Torres 84e735c0ea refactor for more use of move with settings_pack (#1162) 2016-09-28 13:28:43 -04:00
Alden Torres 8caebbd026 alerts refactor to use span, don't break ABI when logging, fix compilation (#1159)
alerts to use span, don't break ABI when logging, fix compilation
2016-09-27 23:21:18 -04:00
Arvid Norberg 97c6a75084 add proper error handling to peer connections and session (#1149)
add proper error handling to peer connections and session. i.e. catch exceptions in asio handlers and catch by const reference
2016-09-25 09:50:48 -04:00
Arvid Norberg 3e7e806a77 deprecate old session_settings API (use settings_pack instead) (#1117)
deprecate old session_settings API (use settings_pack instead)
2016-09-20 23:49:23 -07:00
Arvid Norberg 219b2c36b4 upnp and natpmp modernization and cleanup (#1103)
upnp and natpmp modernization and cleanup
2016-09-18 10:11:56 -04:00
Alden Torres 6c31ea3d44 created dht state and session params refactor (#1100)
created dht state and session params refactor
2016-09-17 09:42:04 -04:00
Alden Torres b4da884f29 created lsd_callback, log optimization and cleanup in lsd (#1099) 2016-09-16 12:21:41 -04:00
Alden Torres d94c317f02 created portmap_callback and refactor for natpmp and upnp log optimization (#1096)
created portmap_callback and refactor for natpmp and upnp log optimization
2016-09-16 09:53:17 -04:00
Alden Torres 0507764d04 consts and refactor, hash_address returns the hash (#1093)
consts and refactor
2016-09-15 21:13:43 -04:00
Alden Torres acf353e26a general session, torrent and peer connection log optimization (#1088)
general session, torrent and peer connection log optimization
2016-09-13 22:46:07 -04:00
Alden Torres 5480e2eedc some consts refs and refactor (#1075)
some consts refs and refactor
2016-09-09 15:02:20 -04:00
Alden Torres 99da5c8017 dht log optimization, consts and refactor (#1073)
dht log optimization and refactor
2016-09-08 19:13:46 -04:00
Alden Torres 0d64bda8d3 refactor to use unique_ptr with session_impl::m_work (#1063) 2016-09-04 21:49:11 -04:00
Alden Torres 585a760588 headers cleanup (#1054)
headers cleanup
2016-09-01 15:04:58 -04:00
Alden Torres bf0008933a refactor to use std::shared_ptr with peer_connection, core and tests (#1050) 2016-08-31 21:42:18 -04:00
Alden Torres 6e891a0211 refactor to use std::shared_ptr with http_connection (#1049) 2016-08-31 12:45:45 -04:00
Alden Torres cdb15ba886 refactor to use std::shared_ptr with torrent (#1048) 2016-08-31 08:27:36 -04:00
Alden Torres 658fa46f0a no warnings in random with openssl-1.1 and minor refactor 2016-08-30 21:23:08 -04:00
Alden Torres e2487c4d24 more use of std::shared_ptr refactor 2016-08-30 10:10:53 -04:00
Arvid Norberg 9ac7475a90 simplify some constructors with in-class initializers (#1038)
simplify peer_connection, torrent and session_impl's contstructors by moving simple parts to their header files
2016-08-29 20:29:27 -04:00
arvidn 74fc0fae9d merged RC_1_1 into master 2016-08-21 16:28:49 -04:00
arvidn df5f2cb31a add missing include 2016-08-21 12:47:53 -04:00
Arvid Norberg 80e5ce9b32 add a default DHT bootstrap node when it's enabled on session startup (#1008)
make the dht bootstrap nodes part of settings_pack instead, to make it possible to set them on startup. and add default
2016-08-21 12:15:19 -04:00
Alden Torres 7cee486cf7 extensions refactor to use span and std::shared_ptr (#1005)
extensions refactor to use span. use std::shared_ptr instead of boost::shared_ptr.
2016-08-17 14:30:24 -04:00
Alden Torres 9b0bc2ed5f peer_plugin refactor (#1002)
refactor of ut_pex peer storage
2016-08-15 21:05:39 -04:00
Alden Torres f51e782905 using string_view in node::incoming_request and plugin::on_dht_request (#1001)
use string_view in node::incoming_request. changed plugin::on_dht_request to use string_view
2016-08-15 16:17:13 -04:00
arvidn 8c8c3d5587 replace boost::function with std::function 2016-08-13 07:07:26 -04:00
Alden Torres 74c8054e8d created session_params and refactor (#993)
created session_params and new session constructor
2016-08-11 20:32:14 -04:00
Alden Torres f57612b82d rename of aux::array_view to span (#933) 2016-07-22 09:31:42 -07:00
arvidn be30bbd08b merged RC_1_1 into master 2016-06-25 17:48:13 -04:00
Alden Torres ba6e1e9194 open default listen interface the same as no default (#848)
open default listen interface the same as no default
2016-06-23 17:54:31 -04:00
Arvid Norberg 6917a11c6b correct error introduced in add_torrent_impl refactor, with regards t… (#846)
correct error introduced in add_torrent_impl refactor, with regards to not having flag_duplicate_is_error set (which is not set by default)
2016-06-23 13:19:35 -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 d3cd568447 plugin callback refactor (#823)
grouping plugins per feature
2016-06-17 22:02:21 -04:00
Arvid Norberg 4d927f4029 modernize disk_buffer_holder to be move-only (#824)
modernize disk_buffer_holder to be move-only
2016-06-16 08:24:41 -04:00
Arvid Norberg c0fb61c5d7 replace the suggest-read-cache logic with something much simpler (#815)
replace the suggest-read-cache logic with something much simpler that doesn't schedule regular jobs and doesn't query the disk cache
2016-06-15 13:29:54 -04:00
Arvid Norberg 223f24ca27 some cleanup and transition to std::unique_ptr (#786)
some cleanup and transition to std::unique_ptr
2016-06-05 14:07:24 -04:00
Alden Torres 7c4d92a627 Share the DHT storage for both IPv4 and IPv6 (#762) 2016-06-03 19:44:16 -04:00
Arvid Norberg be67553897 simplify session pause mechanism by keeping two separate states in torrents and having the session explicitly tell torrents when it's pausing (#779) 2016-06-03 07:32:48 -04:00
Alden Torres cdd067fe4e Minor cleanup (#775)
Minor cleanup
2016-06-02 07:25:06 -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 dceee3b065 simplify session call and replace session_handle and torrent_handle macros (#741)
remove use of macros in session_handle and torrent_handle forwarders
2016-05-21 19:05:42 -04:00
Arvid Norberg 178a41b187 clean up natpmp logging infrastructure a bit as well as test_peer_list (#735)
clean up natpmp logging infrastructure a bit as well as test_peer_list
2016-05-18 01:54:37 -04:00
Arvid Norberg 167cbe74b5 made alerts move-only and remove dispatch function and other deprecated alert functions requiring alert to be copyable (#721) 2016-05-13 08:19:44 -04:00
arvidn 7c108e6c19 merged RC_1_1 into master 2016-05-09 00:30:30 -04:00
Arvid Norberg 5bedf3e7b3 post add_torrent_alert before any other torrent alert (#717)
post add_torrent_alert before any other torrent alert
2016-05-08 23:48:27 -04:00
Arvid Norberg 29902be3a0 some general C++ 11 cleanup. some typedefs and for loops (#709) 2016-05-07 18:46:42 -04:00
arvidn 6cf5ac9dd1 merged RC_1_1 into master 2016-05-06 01:08:05 -04:00
Arvid Norberg f9bc6dbc54 improvements to socks5 support (for 1.1.1 release) (#567)
capture listen IP and port from socks5 BIND response. add tests for socks5 and improve support for capturing the local endpoint (i.e. bind port) for BIND command socket connections. post listen_succeeded_alert when successfully bound to listen socket on SOCKS5 proxy. make sure to announce the socks5 listen port
2016-05-05 17:09:11 -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 0d2c04cb2e remove network thread pool feature (#688)
remove network thread pool feature (it was messy and mostly useful for bittorrent over SSL). The proper solution is to allow every peer run in its own asio strand and have multiple threads running the io service
2016-05-02 02:18:51 -04:00
arvidn 60c119c52d remove mutex in natpmp 2016-05-01 12:28:16 -04:00
arvidn accf13d93e remove mutex in upnp 2016-05-01 12:24:54 -04:00
Arvid Norberg a3de04dffc Merge pull request #675 from ssiloti/unique_ptr
Use unique_ptr where possible
2016-05-01 01:31:04 -04:00
Steven Siloti ff0675e64e use standard array container (#676) 2016-04-30 23:10:47 -04:00
Steven Siloti 2c00a613b2 use unique_ptr to network_thread_pool 2016-04-30 16:49:21 -07:00
Steven Siloti bca41a681f update comments regarding converting shared_ptr to unique_ptr 2016-04-30 16:49:21 -07: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 98fb7df56f use standard unordered containers (#673) 2016-04-30 16:53:20 -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
arvidn 36a5a11ee2 merge fix 2016-04-29 23:34:25 -04:00
Arvid Norberg f0d95f5e3e remove RSS feature (#662)
remove RSS feature
2016-04-29 15:54:21 -04:00
Arvid Norberg 46b33f920b remove explicit cache feature (#661)
remove explicit cache feature
2016-04-29 02:32:00 -04:00
Alden Torres d08bbbc0cc Added asserts related to total_size in create_torrent (#642) 2016-04-26 00:37:47 -04:00
arvidn 3121334346 restore session_time 2016-04-24 18:27:40 -04:00
Steven Siloti 2d9a6b76f1 use asio::protcol instead of an enum/bool 2016-04-24 15:18:47 -07:00
Steven Siloti 356d2506bd extend dht_observer to support IPv6 external addresses 2016-04-24 14:26:57 -07:00
arvidn b5ecfa4f91 fix merge issues 2016-04-24 16:43:45 -04:00
arvidn dec093dc1a Merge branch 'RC_1_1' 2016-04-24 15:41:28 -04:00
Arvid Norberg 7251575d98 This patch does: (#633)
1. simplifies and regularizies creation of listen sockets based on the listen
   interfaces setting.
2. simplifies and improves the behavior of UDP sockets, which are now explicitly
   opened per listen interface
3. transitions udp tracker, DHT and uTP socket manager over to using the new
   udp sockets
4. greatly simplified udp_socket to only wrap a single underlying socket (as
   opposed to one IPv4 and IPv6 socket)
5. improved behavior of bind-to-device
6. introduce an array_view type to make udp packet passing code simpler
7. simplify and make setting of DF flag more robust
8. simplify and regularize port mapping of listen sockets
2016-04-24 15:26:28 -04:00
arvidn ed5673bf5c attempt to make session_time() not return negative numbers 2016-04-23 09:42:32 -04:00
arvidn 04a3c04075 merged RC_1_1 into master 2016-04-20 08:08:05 -04:00
arvidn 774ea740b4 make session_time return uint16_t 2016-04-14 19:22:27 -04:00
arvidn fd4a46342f merge RC_1_1 into master 2016-03-30 00:33:29 -04:00
arvidn 7649610807 fix test_optimistic_unchoking sim 2016-03-27 18:40:53 -04:00
arvidn 96e2693d13 merge RC_1_1 into master 2016-03-19 16:02:46 -04:00
arvidn f7c9062019 deprecate more parts of explicit cache as well as fixing typos of TORRENT_NO_DEPRECATE preprocessor tests 2016-03-19 07:54:29 -04:00
arvidn 3c98868f6c deprecate explicit cache feature 2016-03-18 12:15:03 -04:00
arvidn 77ce318a84 merged RC_1_1 into master 2016-03-17 00:46:05 -04:00
arvidn 317eb2fe2a remove unused disk allocation code 2016-03-16 20:13:28 -04:00
arvidn 6d85c7c5f0 merge RC_1_1 into master 2016-03-08 01:10:48 -05:00
arvidn 442979c318 support filtering which parts of session state are loaded by load_state() 2016-03-06 16:35:49 -05:00
Steven Siloti b52027a02a set enable_dht to true in session::start_dht(entry)
This function needs to enable the dht to match its semantics in pre 1.1 versions
2016-02-26 19:22:28 -08:00
arvidn 0b173c6651 merged RC_1_1 2016-02-23 23:48:29 -05:00
arvidn d8b88ba381 include protocol in portmap_alert 2016-02-21 19:16:00 -05:00
arvidn cdfdbfd6aa fix port mapping for SSL UDP socket 2016-02-21 17:40:27 -05:00
arvidn cc8066bf11 properly deprecated adding torrents by http url 2016-02-21 11:31:42 -05:00
arvidn 6d77000ab0 deprecate ssl_listen setting. instead ssl sockets are specified by an 's' suffix of the port in listen_interfaces. 2016-02-12 15:46:12 -05:00
arvidn 887e79eb22 improve support for listening on multiple sockets and interfaces, with the listen_interfaces setting 2016-02-12 15:44:17 -05:00
arvidn d1e4b57ad4 rename a few members of session_impl to be more descriptive 2016-02-08 18:15:47 -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 3a4f957b63 Merge branch 'RC_1_1' 2016-02-02 02:02:24 -05:00
arvidn 88b7e3768f add sim test for optimistic unchoke round-robin distribution 2016-02-01 20:28:30 -05:00
arvidn f2ce2284da optimize the optimistic unchoke logic. extend the API for extensions to be able to affect the order of optimistic unchokes 2016-02-01 20:28:22 -05:00
Alden Torres 9f3d13281f Documentation typos 2016-02-01 15:00:46 -05:00