Commit Graph

4055 Commits

Author SHA1 Message Date
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