Commit Graph

1642 Commits

Author SHA1 Message Date
arvidn 336030c73b update SSL certificate for test 2016-10-27 18:21:04 -04:00
arvidn 500bb24dba merged RC_1_1 into master 2016-10-26 23:30:58 -04:00
Steven Siloti f5366bd816 use span for scatter/gather lists (#1260)
use span for gather/scatter buffers. remove explicit size parameter from file_op
2016-10-26 20:40:56 -04:00
Alden Torres 6751a1eeb1 removed spaces in template types and more c++11 auto/loop refactor 2016-10-26 00:08:00 -04:00
Arvid Norberg 61af222d92 add utility function for generating peer ID fingerprint (#1249)
add utility function for generating peer ID fingerprint
2016-10-25 08:03:26 -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 6148984426 remove whitespace at end of line (#1245) 2016-10-22 11:47:24 -04:00
arvidn b1e22e6183 merged RC_1_1 into master 2016-10-20 00:36:54 -04:00
Pavel Pimenov 91845aa6c8 Prevent duplicate url (#1231)
prevent creating torrents with duplicate trackers as well as adding duplicate trackers to torrent_info
2016-10-19 17:28:35 -04:00
Alden Torres ded3ed6abf refactor in alert types to use more const fields and more clear API (#1222)
refactor in alert types to use more const fields and more clear API
2016-10-19 01:32:15 -04:00
Arvid Norberg c966435d1c fix issue where shutting down the session immediately and asynchronously starting the DHT would cause a shutdown hang (#1203) 2016-10-10 22:54:19 -04:00
arvidn 6c805bd06d simplify print statements in tests 2016-10-09 20:23:45 -04:00
arvidn 9453fbd54b merged RC_1_1 into master 2016-10-09 20:09:44 -04:00
Arvid Norberg 6bb2d7c017 Sanitize 1.1 (#1197)
enable address sanitizer
2016-10-09 17:00:20 -04:00
Arvid Norberg 879d560f52 run cpplint.py on travis (#1200)
run cpplint.py on travis
2016-10-09 14:51:24 -04:00
arvidn 57704d0249 Merge branch 'master' of https://github.com/arvidn/libtorrent 2016-10-08 14:18:12 -04:00
arvidn 1c89fcda48 merge RC_1_1 into master 2016-10-08 14:17:51 -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 5f7e2eb928 run undefined sanitier on travis/linux (#1134)
run undefined sanitizer on travis/linux. back-port ed25519 unit test from master
2016-10-08 12:29:46 -04:00
Alden Torres 7f060e4a70 fix openssl compilation with boost 1.62 (#1193) 2016-10-08 01:12:15 -04:00
Pavel Pimenov 93d8955750 Fix #1182 (#1188)
Add webseed URL duplicate check
2016-10-07 15:36:40 -04:00
Alden Torres 9343f2fbfb minor header cleanup and refactor (#1179) 2016-10-04 07:43:34 -07:00
Arvid Norberg 7a52a285a1 back-port error_code cleanup from master (#1173)
back-port error_code cleanup from master
2016-10-03 16:32:40 -07:00
Arvid Norberg 8bb7aa62ae generalize and improve http redirect support for web seeds (#1060)
generalize and improve http redirect support for web seeds
2016-10-02 23:08:03 -07:00
Arvid Norberg cebd976cc2 fix error_code vs. error_condition traits (#1169)
fix error_code vs. error_condition traits. deprecate get_*_category(), instead use *_category()
2016-10-02 12:27:50 -07:00
Steven Siloti 85dd682551 fix adding a node with unknown id (#1161)
Commit a414e4c3 broke adding nodes with unknown id to the routing table by
causing them to be evicted when they responded with their real id. This should
have been caught by test_bootstrap, but a typo caused that test to silently
exit early.
2016-09-28 13:28:21 -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 f592d7fcb0 various cleanup and formatting updates (#1158) 2016-09-26 20:05:04 -04:00
Alden Torres 31ce1e5a2c dht headers and minor cleanup (#1157) 2016-09-26 18:04:42 -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 da8af033cc modernize utf8 conversion functions to throw and move (#1145)
modernize utf8 conversion functions to throw and move
2016-09-24 22:16:10 -04:00
Arvid Norberg 48a647a169 String view entry (#1147)
make entry support string_view in its interface, and make it efficient when in in C++14
2016-09-24 06:10:54 -07:00
Steven Siloti 2e0140b6f6 fix peer picking algorithm (#1141)
fix peer picking algorithm. The old code was always picking the first to_pick peers from the set.
2016-09-24 06:08:52 -07:00
Alden Torres 158ae3a4ba consts, minor refactor, typos and test (#1142) 2016-09-23 13:49:39 -07:00
Arvid Norberg 24b271b7c1 Merge pull request #1133 from ssiloti/peer-picker
fix DHT peer picking algorithm. The old code was always picking the first to_pick peers from the set.

* use a sorted vector to store peer announcments

Given the frequency of linear scans being done, std::set is clearly
sub-optimal for storing announced peers. A std::vector is the obvious
choice, which I also decided to make sorted. A sorted vector trades
better performance in announce_peer for slower purging, the latter
being mitigated by batching.

* shrink peers vectors with too much excess capacity
2016-09-23 13:48:00 -07:00
Steven Siloti 89942bf3d4 use a sorted vector to store peer announcments
Given the frequency of linear scans being done, std::set is clearly
sub-optimal for storing announced peers. A std::vector is the obvious
choice, which I also decided to make sorted. A sorted vector trades
better performance in announce_peer for slower purging, the latter
being mitigated by batching.
2016-09-22 21:54:10 -07:00
Alden Torres c7ec987a1b refactor in msg verify_message and minor cleanup (#1131) 2016-09-21 23:04:05 -07:00
Steven Siloti 23e11af899 fix peer picking algorithm
The old code was always picking the first to_pick peers from the set.
2016-09-21 20:21:34 -07:00
Steven Siloti c75b243490 remove redundant protocol parameter (#1128) 2016-09-21 20:00:39 -07:00
Arvid Norberg 770b0def0c Merge pull request #1122 from ssiloti/peers-storage-policy
new peers storage policy
2016-09-21 07:35:34 -07:00
Arvid Norberg 752ff24357 Merge pull request #1123 from aldenml/system-port-and-logs-1.2
* accept port 0 in listen_interfaces
* more session log and source code refactor
2016-09-20 23:50:49 -07: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
Steven Siloti dad0000015 send write token if peer is alraedy stored 2016-09-20 19:35:24 -07:00
Alden Torres 4f6ea4a70d more session log and source code refactor 2016-09-20 11:24:24 -04:00
Alden Torres 089d6c3144 accept port 0 in listen_interfaces 2016-09-20 11:11:24 -04:00
Steven Siloti e2fefb074a always drop the announcing peer when at capacity 2016-09-19 21:51:10 -07:00
Arvid Norberg acf77a5385 fix tail-padding for last file in create_torrent (#1106) 2016-09-18 20:08:27 -04:00
Alden Torres db14df5d0d dht code related refactor and cleanup (#1107)
dht code related refactor and cleanup
2016-09-18 20:08:15 -04:00
Arvid Norberg 80ba45e1fb clean up read_endpoint_list (#1102) 2016-09-18 10:12:54 -04: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
Arvid Norberg 527772420a fix tail padding in file_storage::optimize and improve file placement with some tests (#1105) 2016-09-18 00:24:20 -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 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
Steven Siloti 3d3367387a check the address family of peers in get_peers (#1090) 2016-09-14 11:29:27 -04:00
Alden Torres 224ebc1ded peer_connection log related optimization (#1086)
peer_connection log related optimization and making m_alert_mask atomic
2016-09-13 17:07:22 -04:00
Alden Torres 65cdc15543 more on log, consts, refs and cleanup in dht related code (#1082)
more on log, consts, refs and cleanup in dht related code. moving print_state out of main source code
2016-09-13 08:18:47 -04:00
Alden Torres 4d4eb66c8b some refactor, more const refs and span use (#1078)
some refactor, more const refs and span use
2016-09-11 01:58:48 -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 01e9810f7a more boost types cleanup and handling of deprecated macos libcrypto (#1072)
more boost types cleanup and handling of deprecated macos libcrypto. more granular TORRENT_MACOS_DEPRECATED_LIBCRYPTO
2016-09-07 17:51:18 -04:00
Alden Torres 4c53d7b2da refactor to use std unordered containers and minor cleanup (#1070) 2016-09-06 23:37:36 -04:00
Alden Torres 5e69dc700c minor cleanup and refactor (#1069) 2016-09-06 18:34:03 -04:00
Alden Torres 7a0da72813 use of std::unordered_multimap and fix in resolve_links::match (#1067)
use of std::unordered_multimap and fix in resolve_links::match
2016-09-06 13:04:28 -04:00
Arvid Norberg 994a84cfe8 enable string tests on appveyor (#1064) 2016-09-05 15:17:12 -04: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 fd4c09d7b2 refactor to use std::shared_ptr with traversal_algorithm (#1056)
refactor to use std::shared_ptr with traversal_algorithm. use a more stable linaro gcc link
2016-09-02 16:42:55 -04:00
Steven Siloti 29e6cbbdae fix exit condition when parsing nodes (#1046)
fix exit condition when parsing nodes
2016-09-01 00:49:21 -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 e2487c4d24 more use of std::shared_ptr refactor 2016-08-30 10:10:53 -04:00
Alden Torres 2ac45d17ef ed25519 api refactor (#1041) 2016-08-30 02:37:51 -04:00
Alden Torres ebe53883b5 refactor in escape_string and escape_path to use string_view (#1039) 2016-08-29 22:37:19 -04:00
Alden Torres 32f5f8f257 better integration and API for ed25519 (#1037)
better integration and API for ed25519. using shared_ptr in ed25519_add_scalar
2016-08-29 20:28:42 -04:00
Alden Torres 227b630bd1 added string_ends_with to replace boost (#1034)
added string_ends_with to replace boost
2016-08-26 12:36:09 -04:00
Alden Torres 44d9f456f8 adding support for a more configurable sha512 hasher (#1028)
adding support for a more configurable sha512 hasher, digest32 template, using hasher512.
2016-08-25 19:07:16 -04:00
Alden Torres 73d6ba6ae3 using span in torrent_handle and no optional in torrent_info (#1023) 2016-08-22 11:02:51 -04:00
Arvid Norberg 3f693fde42 fix build (#1025)
fix build
2016-08-21 20:20:46 -04:00
arvidn 74fc0fae9d merged RC_1_1 into master 2016-08-21 16:28:49 -04:00
Arvid Norberg debf3c6e36 update puff.c for gzip inflation (#1022)
update puff.c for gzip inflation
2016-08-21 14:43:44 -04:00
Alden Torres 00510d2b06 more use of span and std::shared_ptr (#1018)
more use of span and std::shared_ptr
2016-08-21 13:37:11 -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
Arvid Norberg daa453ef3b back-port windows stack trace function to 1.1 (#1017)
back port exception handling and stack trace printing from master -> RC_1_1
2016-08-21 01:07:02 -04:00
Alden Torres 4d96939b7b minor cleanup and refactor (#1016)
minor cleanup and refactor
2016-08-20 19:46:55 -04:00
Arvid Norberg 8f7901dd25 build with warnings as errors in autotools build on travis (#1013)
build with warnings as errors in autotools build on travis
2016-08-19 01:05:43 -04:00
Alden Torres 9fd83aaa10 more use of std::shared_ptr (#1009)
more std::shared_ptr transition
2016-08-18 17:08:40 -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
Alden Torres bb388563b3 refactor to use torrent_info with std::shared_ptr (#1006) 2016-08-17 17:26:35 -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 f4127ae12b refactor in crypto_plugin::decrypt to use tuple 2016-08-16 10:21:17 -04:00
Alden Torres 7a2b21407c refactor in crypto_plugin to use span 2016-08-15 23:09:30 -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
Alden Torres 2f7adfbb92 no more deprecated std::random_shuffle (#999)
replace deprecated std::random_shuffle. more aggressive random_shuffle in DHT simulation setup. use travis_retry.
2016-08-14 19:48:31 -04:00
arvidn 8c8c3d5587 replace boost::function with std::function 2016-08-13 07:07:26 -04:00
Arvid Norberg e36e5efaba use boost::string_ref (#996)
use boost::string_ref/boost::string_view in various parts of the code, in file_storage, some file functions and in bdecode.
2016-08-13 07:04:53 -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
Arvid Norberg 8007b947fd make pad-file and symlink support conform to BEP47 (#992)
make pad-file and symlink support conform to BEP47
2016-08-07 22:37:10 -04:00
arvidn 42b3fbe20a merged RC_1_1 into master 2016-08-07 17:23:40 -04:00
Alden Torres af565e2b86 added support for flz (find last zero) and copied bitfield functions from PR #565 (#986)
added support for flz (find last zero) and copied bitfield functions from PR #565
2016-08-07 16:21:08 -04:00