Commit Graph

5765 Commits

Author SHA1 Message Date
Alden Torres a73d424b82 typos 2016-04-15 15:39:41 -04:00
Steven Siloti 9ffadcde62 allow peers to resume allocating disk buffers when their last outstanding write completes 2016-04-09 16:48:05 -07:00
arvidn 5d499e83b6 fix uTP/SSL 2016-04-09 10:50:45 -04:00
Arvid Norberg 774735b046 Merge pull request #600 from arvidn/python-warnings-1.1
fix some build warnings in python binding
2016-04-08 02:17:45 -04:00
arvidn 5c17dc9f31 fix some build warnings in python binding 2016-04-07 22:45:23 -04:00
arvidn cee2b16949 fix some coverity warnings and move out code to torrent_status.cpp 2016-04-07 21:44:24 -04:00
arvidn 876cef0d4c restore the ipv6 http tracker argument, but restricted to only private torrents 2016-04-07 00:06:04 -04:00
Arvid Norberg 6767cf96f1 Merge pull request #546 from arvidn/move-into-self-1.1
fail correctly when move_storage is called to move into itself 1.1
2016-04-06 17:49:05 -04:00
arvidn 387498e54f clean up in piece picker 2016-04-06 00:45:21 -04:00
Alden Torres bb8d1d0e56 Revert utp log file to disable by default
Documentation typos
2016-04-03 22:32:06 -04:00
arvidn dff0e7b0cd fix concurrency issue in part_file::export_file 2016-04-02 21:29:20 -04:00
arvidn 31805ecec0 fix some clang build warnings 2016-04-02 12:27:42 -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 7f232dd195 fix python3 issue in binding 2016-03-30 23:35:47 -04:00
arvidn 7649610807 fix test_optimistic_unchoking sim 2016-03-27 18:40:53 -04:00
arvidn 3e7a6b03e5 remove dead code in peer_connection 2016-03-21 18:47:17 -04:00
arvidn 0095aa084f make coalesce reads and coalesce writes actually work 2016-03-20 16:34:19 -04:00
arvidn a9d12766d4 fix typo in hard_link() 2016-03-20 16:14:29 -04:00
Arvid Norberg db214cc92d Merge pull request #559 from arvidn/direct-io-1.1
remove unused O_DIRECT mode
2016-03-20 14:42:58 -04:00
arvidn 139fb29647 remove unused O_DIRECT mode, and relax/simplify alignment requirements for coalesce_buffers 2016-03-20 00:55:31 -04:00
arvidn 85cf5ac195 remove unused aligned_holder class. fix logging issue of out-of-bound piece requests 2016-03-19 23:32:50 -04:00
Arvid Norberg e9b334ce63 Merge pull request #494 from arvidn/udp-bind-failure-1.1
attempt to fix issue with binding udp sockets on windows
2016-03-19 13:20:51 -04:00
arvidn 53b5e964d2 fix merge issue and properly close ssl udp socket when disabled, prevents the extra listen_succeeded alert for the ssl udp socket 2016-03-19 10:25:35 -04:00
arvidn e9a5985609 if a udp socket is already bound to the IP and port we want to bind it to, don't reopen it 2016-03-19 10:25:30 -04:00
arvidn d705dc2953 attempt to fix issue with binding udp sockets on windows 2016-03-19 10:25:30 -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 c0033d0977 do not enable SSL listen sockets by default 2016-03-18 23:57:02 -04:00
arvidn b446fe4bba deprecate settings_pack::hashing_threads and replace it with aio_threads in documentation 2016-03-18 16:40:52 -04:00
arvidn 3c98868f6c deprecate explicit cache feature 2016-03-18 12:15:03 -04:00
arvidn 1cd5119178 remove/deprecate bad idea with mlock 2016-03-17 19:37:05 -04:00
arvidn 317eb2fe2a remove unused disk allocation code 2016-03-16 20:13:28 -04:00
Arvid Norberg a1d60db706 Merge pull request #547 from arvidn/no-read-cache-1.1
fix use_read_cache=false
2016-03-16 08:14:15 -04:00
arvidn 4926081960 fix use_read_cache=false 2016-03-16 02:22:18 -04:00
arvidn 36d0cfe40d fix shutdown issue caused by peer connections being kept alive by disk buffer pool callbacks 2016-03-16 00:28:19 -04:00
arvidn 08bac479be allow each peer have at least 2 allocated disk blocks at any given time, to avoid stalling when cache_size setting is small. also deprecate use_write_cache 2016-03-16 00:28:11 -04:00
Steven Siloti 4331f57021 restrict check_cache_level to only runing on one thread at a time
If another thread trys to call check_cache_level then m_cache_check_state is set
to indicate that the thread currently in check_cache_level needs to call it again.
2016-03-14 19:03:12 -07:00
Steven Siloti d405535a3f try to free the piece after kicking the hasher and flushing 2016-03-14 19:03:12 -07:00
Steven Siloti e8f93df700 fix indentation 2016-03-14 19:03:12 -07:00
Steven Siloti 826bbe35ee always cache writes 2016-03-14 19:03:12 -07:00
Steven Siloti 6e8db41dd2 check_cache_level after performing a job rather than before
If dirty blocks are added while the job is running there is a chance of
deadlock if the dirty blocks cause the cache to exceed its size limit and
no further jobs come in to trigger another check.
2016-03-14 19:03:12 -07:00
Steven Siloti 9c5bb25d65 always clear outstanding_flush after attempting to flush a cached write
Also clear outstanding_flush before calling kick_hasher because kick_hasher
may unlock the cache mutex which can allow more dirty blocks to be added
which may require another flush_hashed job be added.
2016-03-14 19:03:12 -07:00
Arvid Norberg 82d177472e Merge pull request #541 from arvidn/fix-test-transfer-1.1
improve message from listen_failed_alert
2016-03-14 21:43:34 -04:00
arvidn c5861bcc04 fix failure to increment port when retrying socket binding 2016-03-14 18:52:43 -04:00
Arvid Norberg 42d423e992 Merge pull request #540 from arvidn/remove-purgable-control-1.1
remove the purgable control patch
2016-03-14 17:54:12 -04:00
arvidn 921cbeebed add option to delete just the partfile when removing a torrent 2016-03-14 08:26:39 -04:00
arvidn 55cd19d1e2 remove the purgable control patch. It adds a lot of complexity and it does not perform well 2016-03-14 01:48:00 -04:00
Arvid Norberg 035f8e98d1 Merge pull request #542 from arvidn/request-timeout-1.1
fix seed timing-out unchoked peers for not sending requests
2016-03-14 01:44:50 -04:00
arvidn 58e73c1469 fix typo 2016-03-13 20:47:50 -04:00
Arvid Norberg 5652a46068 Merge pull request #508 from arvidn/part-file-1.1
attempt to fix issue where the partfile is not deleted
2016-03-13 18:05:01 -04:00
arvidn 8f14c74be8 fix issue where a seed could time-out an unchoked peer for not sending any requests, despite being busy servicing requests from the peer (and time out immediately when m_requests is drained) 2016-03-13 16:41:31 -04:00
arvidn fb85e5e60f improve message from listen_failed_alert. Post listen_failed_alert for every failure, including the ones that are re-tried 2016-03-13 16:18:44 -04:00
arvidn 0d0048d415 try to evict a volatile piece before allocating a new one for a hash check. It may be faster to check files without growing the cache, or reusing the same buffers. 2016-03-13 12:52:44 -04:00
arvidn 2178d1ad2b improve robustness and performance of uTP PMTU discovery. fix duplicate ACK issue in uTP. demote an invariant check to 'expensive' 2016-03-13 12:40:59 -04:00
arvidn 71e3fb8941 fix division by zero in super-seeding logic 2016-03-07 23:40:01 -05:00
arvidn f5d5ac4f3a fix bug where disk cache was wiped out after completion file-checking. factor out sim test utilities and reuse them in the regression test 2016-03-06 21:44:38 -05:00
Arvid Norberg 3fa3004b85 Merge pull request #526 from arvidn/rechecking-outstanding-1.1
always keep at least 2 async hash jobs outstanding
2016-03-06 20:05:56 -05:00
arvidn 442979c318 support filtering which parts of session state are loaded by load_state() 2016-03-06 16:35:49 -05:00
arvidn 67774d660d always keep at least 2 async hash jobs outstanding when rechecking torrents (to keep the bandwidth delay product full) 2016-03-06 16:31:18 -05:00
arvidn b40430f175 change the cache size calculation for auto cache size (-1) to be smaller, especially for machines with large amounts of RAM 2016-03-06 16:15:22 -05:00
arvidn a02c1d2164 record cache settings in the job instead of checking it twice for more robust behavior 2016-03-06 16:15:13 -05:00
arvidn 8ca76f9d59 fix support for auto disk cache size and disk buffer pool allocator behavior 2016-03-06 16:14:55 -05:00
arvidn 26f88bb12d add receive_buffer unit test and some more cleanup and asserts 2016-03-05 00:14:00 -05:00
arvidn 2efb9d9a6a fix bug in receive_buffer 2016-03-05 00:13:59 -05:00
Arvid Norberg be17b78c5f Merge pull request #522 from arvidn/io-thread-assert-1.1
remove invalid assert in the disk thread
2016-03-04 23:16:02 -05:00
arvidn 2bd6ad9974 remove invalid assert in the disk thread 2016-03-04 20:20:49 -05:00
Arvid Norberg 00f3406402 Merge pull request #514 from arvidn/allowed-unchoke-1.1
attempt to uphold the invariant that the num_unchoke_slots
2016-03-04 16:43:38 -05:00
arvidn b707a4de90 uphold the invariant that the num_unchoke_slots counter is int max as long as the unchoke slots limit < 0 2016-03-04 16:42:36 -05:00
Alden Torres 4998bfedc6 Documentation typos 2016-03-04 10:43:25 -05:00
arvidn b9ec183e24 increase default connect speed. minor cleanup. add logging for short lived connections 2016-03-03 01:20:15 -05:00
arvidn fbef47d3ec fix edge case in uTP stream when receiving a close-reason code 2016-03-02 22:30:02 -05:00
arvidn e851b79865 fix issue when shutting down a torrent with outstanding async operations 2016-03-02 01:16:08 -05:00
arvidn aeb9f1c5dd fix bug in enum_net_interfaces 2016-02-29 18:14:10 -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 f563bf9cac attempt to make the alert type backwards compatible with cloning the state when building with deprecated functions enabled 2016-02-27 20:25:17 -05:00
arvidn ac2916c426 enable disk cache pool allocator by default. fix ansi escape code conversion in client_test on windows 2016-02-27 17:42:31 -05:00
arvidn 07ecf7c1bd remove invalid assert 2016-02-27 00:25:21 -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
Arvid Norberg 842d6fbca4 Merge pull request #492 from arvidn/fix-ssl-deprecated-1.1
fix build with openssl and deprecated functions disabled
2016-02-24 21:18:43 -05:00
arvidn d4f259ccf0 attempt to fix race when closing a web seed while it's receiving data 2016-02-24 02:23:09 -05:00
arvidn e5ccb63375 fix build with openssl and deprecated functions disabled 2016-02-24 02:07:27 -05:00
arvidn dcd6af6473 more fixing of test_transfer proxy tests 2016-02-24 00:03:56 -05:00
arvidn 57aa813135 fix auto-managed issue with torrents transitioning to 'slow' as they get paused, returning to life again later because of it 2016-02-23 01:28:58 -05:00
arvidn 72a3771b87 attempt to fix logic around around actually closing udp sockets (specifically the SSL UDP socket) 2016-02-21 20:00:55 -05:00
arvidn d8b88ba381 include protocol in portmap_alert 2016-02-21 19:16:00 -05:00
arvidn 61a67ece4a fix non-openssl build 2016-02-21 18:40:06 -05:00
arvidn cdfdbfd6aa fix port mapping for SSL UDP socket 2016-02-21 17:40:27 -05:00
arvidn 13e9eb6680 forward-port outgoing interface fix from RC_1_0 2016-02-20 20:35:52 -05:00
Arvid Norberg 5d18800e04 Merge pull request #486 from arvidn/force-recheck-1.1
make force recheck a bit more robust
2016-02-20 19:53:56 -05:00
arvidn 3231aa4c9d make force recheck a bit more robust by initializing the progress state immediately 2016-02-20 15:53:43 -05:00
arvidn 3f40890eb6 simplify logic for saving resume a bit 2016-02-20 15:45:46 -05:00
arvidn 5cf36fd1d6 only save pieces in resume data that have actually been checked 2016-02-20 00:48:17 -05:00
arvidn 828e79472d forward port enum_net MTU fix 2016-02-11 00:46:28 -05:00
Arvid Norberg 7d8566f694 Merge pull request #473 from arvidn/bind-ssl-fix-1.1
fix issue in socket binding and back-port ssl test reliability fix
2016-02-10 19:47:34 -05:00
arvidn ee14337894 revert listen_failed_alert::port 2016-02-10 18:28:34 -05:00
arvidn ceb0ac6148 fix issue in socket binding and back-port ssl test reliability fix 2016-02-10 02:09:12 -05:00
arvidn 44abd1a59b forward port fix to post torrent_added_alert earlier, from RC_1_0 2016-02-08 15:28:13 -05:00
arvidn dd48faa8d4 minor debug logging issue in test facility wait-for-alert and fix minor shutdown issue with udp_socket packet subscription 2016-02-08 02:05:00 -05:00
Arvid Norberg 7b1a8ff6f1 Merge pull request #465 from arvidn/got-tracker-1.1
removed unused field in torrent
2016-02-07 14:50:08 -05:00
arvidn f4627db97f removed unused field in torrent 2016-02-07 02:37:32 -05:00
arvidn f8a53d17ec un-deprecate the endpoint field in listen_failed_alert 2016-02-07 02:12:58 -05:00
arvidn df353bc3f9 forward port typo fix in udp_socket from RC_1_0 2016-02-06 15:49:25 -05:00
arvidn 74554de330 forward port GetAdaptersAddresses from RC_1_0 and fix error categories in enum_net.cpp 2016-02-05 01:08:09 -05:00
arvidn b0cc0f84ab support NULL being passed as the listen interface to session constructor 2016-02-02 23:17:51 -05:00
arvidn 0f747695b7 fix error handling bug in logging 2016-02-02 01:57:56 -05:00
arvidn e3fc6083bb fix typo in listen_failed_alert 2016-02-01 20:53:58 -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
Arvid Norberg 764c8a7f0c Merge pull request #446 from arvidn/default-gateway-fix-1.1
forward port removal of special case for windows and mingw-1.1
2016-02-01 01:50:28 -05:00
arvidn 55024ccc4b forward port removal of special case for windows and mingw in get_default_gateway that appeared wrong 2016-01-31 21:14:15 -05:00
arvidn e113e8cdf3 minor cleanup of listen sockets 2016-01-31 19:40:31 -05:00
arvidn e584c30b29 forward-port reuse address patch for windows 2016-01-31 18:16:26 -05:00
arvidn acd929381e restore the endpoint field in listen_failed_alert (but deprecated) and add a port field 2016-01-31 10:20:10 -05:00
arvidn efe32c6a0e rewrite most of web_peer_connection::on_receive to make it a lot simpler and fix edge cases with pad-files 2016-01-28 01:58:33 -05:00
arvidn f31d17c9c5 allow specifying which tracker to scrape in torrent_hadnle::scrape_tracker 2016-01-26 18:14:32 -05:00
arvidn 73289cb8ae fix use of uninitialized variables in default_storage 2016-01-25 19:11:57 -05:00
Alden Torres f71d775238 Allow xp compilation with the use GetFileInformationByHandleEx. 2016-01-25 12:22:33 -05:00
Steven Siloti 21feab838d Enable SNI for outgoing SSL connections
Fixes #429
2016-01-24 12:24:33 -08:00
arvidn 2a0e64df46 add run-time check to file_storage::map_block and improve its documentation 2016-01-22 17:17:35 -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
Alden Torres 218d33c545 Documentation typos and minor cleanup 2016-01-20 20:48:23 -05:00
arvidn fbb246094b fix windows build 2016-01-19 21:21:00 -05:00
arvidn 2fa84b3aa5 fix incorrect use of WaitForMultipleObjects 2016-01-19 18:47:21 -05:00
arvidn 784f8806a4 fix asio debugging feature 2016-01-18 23:13:50 -05:00
arvidn 595fe157a9 fix shutdown issue 2016-01-18 20:48:27 -05:00
arvidn 4cbbb0620e only strip trailing dots and spaces from filenames on windows 2016-01-18 13:07:04 -05:00
arvidn 1f9f588e75 merge copyright year update and changelog from RC_1_0 2016-01-17 18:57:46 -05:00
Arvid Norberg fa391d4961 Merge pull request #394 from arvidn/forward-port-http-fix
forward port fix for web seeds not being used by torrents added by URL
2016-01-17 17:47:25 -05:00
arvidn 0c971d0d62 forward port fix for web seeds not being used by torrents added by URL 2016-01-16 23:57:33 -05:00
arvidn 3cd57b59e0 when a tracker is force announced or scraped by the user/client, the resulting response or failure alert is now posted regardless of the alert mask. Since it's user initiated, it's reasonable to expect the user to be interested in the response 2016-01-16 21:24:04 -05:00
arvidn 78d306157b forward port of windows symlink fix from RC_1_0 2016-01-16 01:53:27 -05:00
Arvid Norberg cdc3e720d6 Merge pull request #386 from arvidn/win-file-error-handling
fix missing error handling in windows preadv/pwritev emulation
2016-01-13 21:50:49 -05:00
arvidn c8f119c1a1 fix typo 2016-01-13 01:07:27 -05:00
arvidn 4a28e95ce0 fix missing error handling in windows preadv/pwritev emulation 2016-01-13 00:49:17 -05:00
arvidn 13f03ce38a print the actual stats in session_stats_alert::message() and make parse_session_stats.py parse the alert output. add stats_metric objects for all performance counters 2016-01-12 23:34:37 -05:00
arvidn f4d643bd2d instead of restarting the whole DHT when changing external IP, just rebuild the routing table and change the node IDs 2016-01-11 21:17:25 -05:00
Alden Torres 20d8f4e3f7 Removed unused fields in field class 2016-01-11 12:07:36 -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
Alden Torres 0f442f59f3 Avoid pass IPv6 address to current implementation of DHT while adding a node 2016-01-09 18:46:19 -05:00
arvidn e06daa68a4 overhaul the dht simulator (setup_dht) to be more flexible and cheaper to run thousands of nodes 2016-01-09 01:08:52 -05:00
Alden Torres 7b34379c87 Doc typos 2016-01-05 08:31:04 -05:00
Arvid Norberg 7282195ef0 Merge pull request #355 from arvidn/dht-add-node
simplify dht routing table add
2016-01-03 09:54:30 -05:00
arvidn d954ae1b18 simplify dht routing table add 2016-01-02 20:03:18 -05:00
Alden Torres b9a5525ab2 Store dht_settings::max_peers in session state 2016-01-02 11:49:07 -05:00
arvidn 07ddb010c5 split buckets when exceeding the next bucket's size, to make sure we split before risking discarding nodes because the next bucket is smaller 2016-01-02 00:45:44 -05:00
arvidn e3ba811ae4 improve name of m_timer in dht_tracker 2016-01-01 16:42:44 -05:00
arvidn 01e6b93854 simplify and improve unit test for distance_exp. make some immutable variables const in the DHT implementation. instead of waking up periodically just to check if it's time to refresh the DHT secret key, set the timer to only wake up to refresh the key. If we don't have a DHT observer (to ask for our external IP) or if we don't know our external IP, don't generate a node ID based on 0.0.0.0, just generate a random ID instead. Simplified and improved node replacement logic in the routing table a little bit 2016-01-01 16:42:37 -05:00
Arvid Norberg ffb78f0378 Merge pull request #312 from ssiloti/export-verify-message
export verify_message and incoming_error
2015-12-30 22:51:38 -05:00
Steven Siloti ac01ccc43a add templated wrapper around verify_message
It was too easy to forget to update the ret and size parameters
when the size of desec changed. With this change we now automatically
get the size of desc and enforce that ret has the same size.

It would be nice if we could use bdecode_node ret[static Size] from C99
but that is not widely supported.
2015-12-29 20:35:36 -08:00
arvidn 1698dc75dc remove redundant boost::bind 2015-12-25 15:59:50 -05:00
Arvid Norberg 03e90d45d8 Merge pull request #339 from arvidn/dht-storage-test
extend the unit test of dht_storage
2015-12-20 02:02:56 -05:00
arvidn 626baade75 fix dht_storage bug 2015-12-19 22:06:25 -05:00
arvidn 3460f203f3 extend testing of sanitize_append_path_element 2015-12-19 20:11:22 -05:00
arvidn 28749466a2 fix build 2015-12-19 02:40:10 -05:00
arvidn 15ec839d33 extend the unit test of dht_storage 2015-12-19 02:09:06 -05:00
arvidn e9b98c7d2e GetFileAttributesEx fix 2015-12-19 00:12:11 -05:00
arvidn 1f3f06a836 forward port fix for deleting files of magnet link to master 2015-12-18 18:33:31 -05:00
arvidn 645b121df6 deprecate resolve-countries 2015-12-14 21:32:30 -05:00
Arvid Norberg 87dcd690d8 Merge pull request #327 from arvidn/stop-when-ready-fix
polish the stop-when-ready flag and improve documentation
2015-12-14 00:42:57 -05:00
Arvid Norberg 3516e53fa2 Merge pull request #329 from arvidn/warnings-fix
mark up some override functions and fix other clang warnings
2015-12-13 22:12:52 -05:00
arvidn 1712a8e4b4 polish the stop-when-ready flag and improve documentation 2015-12-13 20:31:28 -05:00
arvidn 505ae508f4 mark up some override functions and fix other clang warnings 2015-12-13 19:44:42 -05:00
arvidn 4b6e11cc07 deprecate set_tracker_login 2015-12-13 15:14:19 -05:00
Arvid Norberg 9e51700739 Merge pull request #325 from arvidn/set_web_seeds
add set_web_seeds to torrent_info
2015-12-13 11:24:59 -05:00
arvidn 121b686a39 add set_web_seeds to torrent_info 2015-12-12 18:36:15 -05:00
arvidn 0f9d82ab22 fix bug in handling force-started checking torrents 2015-12-12 15:08:38 -05:00
Arvid Norberg 550b0bb047 Merge pull request #313 from arvidn/setup-swarm-cleanup
clean up setup-swarm simulation utility to be more flexible
2015-12-12 14:07:26 -05:00
arvidn d505f93d7a port sim tests to use the new setup_swarm API 2015-12-12 00:41:47 -05:00
arvidn d80a129871 fix gcc warnings 2015-12-12 07:15:24 +02:00
Steven Siloti c6f1e0bd7b export verify_message and incoming_error
Also move these functions to a new msg.cpp. They are useful for plugins
which implement DHT extensions.
2015-12-05 18:20:08 -08:00
arvidn cc3b064cff fix graceful pause issue. peers regularly check whether they should disconnect or not 2015-12-04 23:27:43 -05:00
Alden Torres 409cfaccc1 Fix num_alert_types. 2015-12-03 22:04:32 -05:00
arvidn 8732863a9a another fix to receiving malformed DHT error message 2015-12-03 01:08:27 -05:00
arvidn 2acb3dcb24 clean up use of getrlimit() by wrapping it and move it to platform_util.cpp. Also take the opportunity to make it simulator friendly (consistent in simulation) 2015-12-02 00:45:34 -05:00
arvidn 12dde0f415 actually add a test to the unit test 2015-11-30 19:07:35 -05:00
arvidn 7540a6e5cc correctly check incoming DHT error messages 2015-11-30 18:02:00 -05:00
Arvid Norberg d0da753fb8 Merge pull request #302 from arvidn/fix-save-resume
fix save_resume_data in client_test
2015-11-30 17:17:57 -05:00
arvidn 60df41cd85 fix save_resume_data in client_test and make torrent a bit more instrumentable. This could be greatly simplified if resume data would not have file_sizes and timestamps 2015-11-29 20:31:57 -05:00
arvidn 87b64f083a fix python build 2015-11-29 11:12:58 -05:00
arvidn 332799bff2 make alert types declared final and disable the log alert declarations when logging is disabled 2015-11-29 10:16:02 -05:00
arvidn e9c0fc8eb5 fix bug that disabled rarest-first piece picking. introduced when removing speed-affinity in the piece picker 2015-11-29 08:26:00 -05:00
arvidn fd3b53604c add new piece picker logging alert category 2015-11-29 08:25:55 -05:00
arvidn 2c3d7ee0ef fix a bug where the torrent's invariant was not always maintained as well as a shutdown issue (now covered by test as well) 2015-11-28 14:14:49 -05:00
Arvid Norberg 359fc5648b Merge pull request #296 from arvidn/udp-read-handler
more efficient handler allocation for udp and second_tick
2015-11-28 01:06:10 -05:00
arvidn a8e31fd8ca add first coverage of test_transfer as a proper sim 2015-11-28 00:59:39 -05:00
arvidn 98c3b75b55 use more efficient (in-place) handler allocation for udp async_read and session second_tick 2015-11-28 00:57:44 -05:00
arvidn 51df32a25b fix logging issue 2015-11-27 14:04:46 -05:00
arvidn 847cd340ee extend tracker sim test and fix some bugs in tracker error reporting 2015-11-24 23:38:49 -05:00
arvidn 06b648203f clean up use of error categories 2015-11-24 00:50:51 -05:00
arvidn e3dad98fbe fix an old use of posix_category. make http_connection translate IPs into proper endpoints when connecting over socks (instead of passing the IP on as a hostname string). add test coverage 2015-11-24 00:39:02 -05:00
arvidn 92236a9923 clean up error_code use, and use error_condition to test for errors in test_http_connection 2015-11-24 00:39:01 -05:00
arvidn 174e0aeb46 fix semantics of socks5_stream and http_connection to make them not close themselves. Add socks5 and socks4 proxy coverage in test_http_connection 2015-11-24 00:39:01 -05:00
arvidn 91868f2086 add test for gzipped http responses 2015-11-24 00:39:01 -05:00
Thomas Yuan 603ef84c65 Fix observer_size. 2015-11-23 11:06:20 -05:00
Steven Siloti 9c7edf803e add override and a TODO 2015-11-22 18:58:32 -08:00
Steven Siloti 9f7aa7f3a6 fix segfault in put_data
If less than three nodes are found to put an item to then traversal_algorithm::start
will add router nodes. This leads to a crash in put_data::invoke when it tries to
read a token from uninitialized memory in a null_observer.
2015-11-22 16:05:24 -08:00
Steven Siloti 1f13343a70 const correctness 2015-11-22 10:02:26 -08:00
Steven Siloti 8a984effa7 allow done() with a non-zero invoke count 2015-11-22 10:02:26 -08:00
Steven Siloti 6c5bed63d3 whitespace cleanup 2015-11-22 10:02:26 -08:00
Arvid Norberg ddddce6e2a Merge pull request #280 from arvidn/stop-start-test
stop-start test
2015-11-21 02:31:11 -05:00
Arvid Norberg 42b129b9d5 Merge pull request #178 from thomas-yuan/put
Make dht_put_alert more accurate.
2015-11-21 02:30:45 -05:00
arvidn c0d6b20634 extend swarm simulation test to include stopping and starting and graceful pause 2015-11-20 22:27:12 -05:00
Arvid Norberg 2eabf99307 Merge pull request #276 from arvidn/msvc-warnings
attempt to fix some msvc warnings
2015-11-20 08:04:38 -05:00
arvidn 4c790043a1 fix invariant check failure in torrent::pause 2015-11-20 01:38:21 -05:00
Thomas Yuan ab70ad3e05 fix comments and unit test 2015-11-20 00:06:08 -05:00
Thomas Yuan 194ad410dc Make dht_put_alert more accurate. 2015-11-20 00:06:08 -05:00
arvidn 4aaa8ca4a9 silence msvc performance warnings. introduce more override and finals 2015-11-19 23:37:45 -05:00
arvidn fba0762353 fix some msvc warnings 2015-11-19 19:01:54 -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
Steven Siloti 86116caf4c fix assert after a DHT get/put request
If an observer is abandoned due to there being more than 100 results in a
traversal then the traversal may complete while the observer is still
outstanding. When the observer times out or is aborted it calls
traversal_algorithm::failed() which asserts because m_invoke_count has been
cleared to zero by traversal_algorithm::done().

To fix this add a check when abandoning observers to see if they have an
outstanding query. If they do then flag them as done to prevent them from
calling back into the traversal and decrement the invoke count.

Fixes #271
2015-11-16 21:05:32 -08:00
Steven Siloti ba1ccdec66 fix assert in dht::observer
This is was introduced by c2277b3ea5
"fix traversal_algorithm::done() being invoked more than once".
2015-11-14 18:30:42 -08:00
Arvid Norberg 64aba31e30 Merge pull request #263 from thomas-yuan/dead_loop_on_ios
Fix iOS dead loop issue.
2015-11-14 12:55:53 -05:00
Arvid Norberg bdfed667e3 Merge pull request #267 from arvidn/storage-fix
fix support for incomplete reads/writes from disk
2015-11-14 12:54:57 -05:00
arvidn c7a4eefd69 fixed typo 2015-11-14 02:22:35 -05:00
Thomas Yuan b536cd4ab4 Fix iOS dead loop issue. 2015-11-14 00:53:39 -05:00
arvidn fb2f2731cf fix support for incomplete reads/writes from disk 2015-11-14 00:21:03 -05:00
Alden Torres 611d0c1c6e Fixed to make it compatible with mingw-w64 and generic linux 2015-11-13 07:55:28 -05:00
Steven Siloti 1bd706ac14 the simulator always supports IPv6 2015-11-12 20:52:30 -08:00
Arvid Norberg ef1f399fd3 Merge pull request #259 from arvidn/deterministic-rand
use a consistent random number generator
2015-11-12 21:45:09 -05:00
Arvid Norberg 401f12b287 Merge pull request #260 from arvidn/ip-filter
fix IP filter bug when adding a torrent after setting the filter
2015-11-12 21:44:40 -05:00
arvidn 524cf00fcb forward port of version change from RC_1_0 2015-11-12 21:35:50 -05:00
arvidn d4d5f37222 fix typo 2015-11-12 01:42:44 -05:00
arvidn 2626159abe use a consistent random number generator to make simulations deterministic 2015-11-12 00:21:56 -05:00
arvidn 8fa6863e15 fix IP filter bug when adding a torrent after setting the filter 2015-11-11 20:43:42 -05:00
Arvid Norberg bae2b3394f Merge pull request #258 from arvidn/version
forward-port version function from RC_1_0
2015-11-11 19:13:44 -05:00
arvidn fbf152abc0 attribute external IP voting to the actual tracker IP we connected to, and preserve endpoint list in http_connection to make the re-announce to IPv6 logic robust 2015-11-11 01:30:28 -05:00
arvidn 4c0b00c390 forward-port version function from RC_1_0 2015-11-11 00:57:51 -05:00
Steven Siloti c2277b3ea5 fix traversal_algorithm::done() being invoked more than once
A traversal can be done while there are still outstanding queries (i.e.
m_invoke_count is non-zero) if K good responses have already been received and
none of the outstanding queries are closer than the nodes which have responded.

When this happens and the outstanding queries eventually complete or timeout
they call traversal_algorithm::failed() or traversal_algorithm::finished() as
usual which will cause traversal_algorithm::done() to be called yet again.

The fix is to always set the done flag on all queried observers in
traversal_algorithm::done() so that the observers will refrain from calling
back into the traversal.

This also makes traversal_algorithm::abort() redundant since this was the only
thing it did before it called into done().
2015-11-09 20:47:33 -08:00
arvidn 4814855933 update cache_size docs and raise the cap for 32 bit builds 2015-11-08 10:49:38 -05:00
arvidn 9c10e99aef forward port fix to not auto-detect disk cache size greater than the virtual address space for 32 bit builds 2015-11-07 22:00:20 -05:00
Arvid Norberg 61138630a3 Merge pull request #245 from arvidn/invalid-request
handle receiving an invalid request
2015-11-07 21:19:31 -05:00
arvidn a48cb785d0 forward port piece_block patch from RC_1_0 2015-11-07 18:50:54 -05:00
arvidn a138b2daa9 handle receiving an invalid request 2015-11-07 14:58:08 -05:00
arvidn 1fa184ba8a fix msvc-10.0 build 2015-11-07 10:01:01 -05:00
arvidn 00090b8284 fix typo in test_checking, introduced by recent error_code in torrent_status patch 2015-11-07 01:01:07 -05:00
arvidn ced0f74bf8 minor moving around of code 2015-11-06 00:38:42 -05:00
arvidn ebb9fdaf54 add error_code to torrent_status instead of error string 2015-11-05 20:43:23 -05:00
arvidn ee714306be forward port IPv6 IP address resolution in URLs fix 2015-11-01 17:26:45 -05:00
arvidn f5da27ba9e support large info-sections in torrent_info 2015-10-31 10:53:39 -04:00
arvidn 3462c061a7 merged error handling fix from RC_1_0 2015-10-31 10:06:15 -04:00
Steven Siloti bd0c237134 simulator: support IPv6 in enum_routes() 2015-10-29 20:43:51 -07:00
arvidn 729a8e9152 update libsimulator. add simulation/test for announcing twice to trackers over IPv4 and IPv6. fix bugs preventing libtorrent from doing that correctly 2015-10-27 00:21:07 -04:00
arvidn 3cc464805f update libsimulator submodule 2015-10-25 10:55:20 -04:00
arvidn a75dfe2eb6 silence warnings in boost headers in dht_storage 2015-10-25 09:30:56 -04:00
arvidn 234ac8adeb update libsimulator submodule with IPv6 support 2015-10-24 15:57:22 -04:00
arvidn e31433d952 flush and close the partfile when releasing files in default storage 2015-10-24 15:35:42 -04:00
Steven Siloti 4151c8e366 assert that the signature is valid when assigning a mutable value to an item 2015-10-21 20:29:29 -07:00
Arvid Norberg ea86785d45 Merge pull request #202 from arvidn/stop-when-ready
Stop when ready
2015-10-04 16:18:59 -04:00
arvidn 8eded0a2a0 forward port set_allow_peers bugfix 2015-10-04 14:41:58 -04:00
arvidn 51c6079c42 add stop-when-ready feature, to support checking torrents without starting the download afterwards 2015-10-04 13:08:23 -04:00
arvidn e59d03f684 fix strict aliasing violation 2015-10-03 15:13:45 -04:00
arvidn 3d54c02450 fix build 2015-10-03 11:42:21 -04:00
arvidn c798e388a9 forward port fix to proxy_peer_connections to master 2015-10-03 11:20:10 -04:00
Arvid Norberg b785e789b6 Merge pull request #199 from arvidn/parse-magnet-fix
fix bug in parse_magnet_uri and improve unit test
2015-10-03 02:09:34 -04:00
arvidn c1955ecb18 fix bug in parse_magnet_uri and improve unit test 2015-10-02 23:24:17 -04:00
Alden Torres 62b24d8b67 Add set_dht_storage to session API. 2015-10-02 09:00:07 -04:00
Arvid Norberg c56e878ff4 Merge pull request #194 from arvidn/merge_http
forward port merge web seed patch
2015-10-01 01:46:18 -04:00
Arvid Norberg d7cdcf9369 Merge pull request #183 from thomas-yuan/ta_init
start 'find' from near nodes instead of all of nodes in routing table.
2015-09-30 00:43:14 -04:00
arvidn 424e51b737 fix build 2015-09-30 00:41:41 -04:00
arvidn a00e5aa6c7 forward port patch to have resume data web seeds override .torrent file web seeds, and a flag to merge them 2015-09-30 00:41:41 -04:00
arvidn 5da511f140 now that force-started torrents aren't affected by the auto-manager, they need to be explicitly kicked when entering checking state (it would be nice if all this could be done through set_state()) 2015-09-29 20:49:38 -04:00
arvidn dab0f8b8d0 simplify the queuing logic for checking torrents. make all non-auto-managed torrents always be exempt from any queuing mechanism (including checking). Extend documentation on how it works 2015-09-29 20:49:37 -04:00
arvidn 8b30e78d69 forward port fix for bug where dont_count_slow_torrents could not be disabled, into master 2015-09-25 14:22:38 -07:00
Alden Torres 197a443465 Fix of dht_storage_counters::peers counter. 2015-09-24 10:50:04 -04:00
Thomas Yuan 0d2644802d start 'find' from near nodes instead of all of nodes in routing table. 2015-09-23 17:04:33 -04:00
Thomas Yuan f9fa8ffdec Use ping instead of get_peers if current bucket is full. 2015-09-22 10:35:10 -04:00
Arvid Norberg 50ccce6eed Merge pull request #174 from arvidn/fallocate-hack
remove fallocate hack (in master)
2015-09-22 07:18:07 -07:00
arvidn 5bdb583162 remove fallocate hack (in master) 2015-09-21 20:22:19 -07:00
Thomas Yuan 7fec9e488d make immutable/mutable items lifetime configurable. 2015-09-21 20:32:37 -04:00
Arvid Norberg 01193fcf7c Merge pull request #163 from aldenml/dht-storage-counters
Create dht_storage_counters to avoid internal counter in future public API
2015-09-21 13:51:39 -07:00
Alden Torres 25ed70b977 Create dht_storage_counters to avoid internal counter in future public API. 2015-09-21 07:46:23 -04:00
arvidn fb2f659a31 fix bug in time keeping of active_time, seeding_time, finished_time etc. 2015-09-21 00:38:56 -07:00
Arvid Norberg 6bf1971452 Merge pull request #162 from thomas-yuan/bootstrap
Only re-bootstrap when there is no enough nodes in routing table.
2015-09-20 14:52:16 -04:00
arvidn cf15453388 forward port auto-manage fix from RC_1_0 2015-09-19 02:10:50 -04:00
arvidn 2715ae475c expose whether torrents are announcing to trackers, lsd and dht. these can be disabled by the queuing logic 2015-09-19 01:54:47 -04:00
arvidn b628692223 separate out announce_entry and torrent_status into their own headers 2015-09-18 08:08:08 -04:00
Arvid Norberg c54f8445bd Merge pull request #164 from thomas-yuan/alert_message
Fix dht_put_alert::message() for immutable items.
2015-09-17 18:25:17 -04:00
Thomas Yuan 20708fa5b6 Only re-bootstrap when there is no enough nodes in routing table. 2015-09-17 11:22:23 -04:00
arvidn c9a0212ee0 add simulation of tracker announces 2015-09-16 20:49:10 -04:00
Thomas Yuan 1fac816d37 Fix dht_put_alert::message() for immutable items. 2015-09-16 15:21:05 -04:00
Alden Torres e2d682275a Implementing and using new dht storage interface 2015-09-16 08:30:27 -04:00
Arvid Norberg dc91e7f507 Merge pull request #154 from thomas-yuan/counter
Fix dht counters.
2015-09-11 21:45:39 -04:00
Thomas Yuan c0d20d7708 Fix dht counters. 2015-09-11 13:58:33 -04:00
Arvid Norberg 4fd56fd220 Merge pull request #145 from arvidn/super-seeding-fix2
fix super seeding assert (forward port from RC_1_0)
2015-09-10 20:13:14 -04:00
Arvid Norberg 8b6b8240c1 Merge pull request #144 from thomas-yuan/master
load_state should restart dht/proxy if there is dht state/proxy.
2015-09-10 00:13:07 -04:00
Arvid Norberg 7114648f33 Merge pull request #146 from arvidn/convert-from-native
correctly convert error messages from native to utf8
2015-09-10 00:09:37 -04:00
Thomas Yuan a06a8fe19e load_state should restart dht/proxy if there is dht state/proxy. 2015-09-08 21:34:49 -04:00
Arvid Norberg abe994c191 Merge pull request #128 from thomas-yuan/patch2
Add read-only support in dht_settings and outgoing query messages.
2015-09-08 19:47:18 -04:00
arvidn a10438addd correctly convert error messages from native to utf8 2015-09-08 19:27:15 -04:00
arvidn c0a4f7ba26 fix super seeding assert (forward port from RC_1_0) 2015-09-08 18:17:13 -04:00
Thomas Yuan 4d6de4bcd8 save/load all dht_settings. 2015-09-08 11:03:27 -04:00
Thomas Yuan d6bb387ab9 Use dht_settings directly instead of add a read_only member variable.
Since rpc_manager has a reference of dht_settings, needn't pass it
as a parameter for incoming().
2015-09-08 10:35:30 -04:00
arvidn ee3cb6cf86 move some internal headers to aux_ to fix documentation 2015-09-07 17:00:27 -04:00
Thomas Yuan 3d4ed9f37f Add read-only support in dht_settings and outgoing query messages. 2015-09-07 14:24:46 -04:00
arvidn 05c580572d disable simulation on travis osx. fix more warnings 2015-09-06 22:55: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 b45c585a78 use gcc on linux and clang on osx 2015-09-06 22:55:41 -04:00
arvidn 379fd8ce81 fix simulation build 2015-09-06 22:52:25 -04:00
arvidn 9cb4e3d1ca forward-port supports_ipv6() fix for linux from RC_1_0 (and fix bug in it) 2015-09-06 20:53:06 -04:00