Commit Graph

10312 Commits

Author SHA1 Message Date
Steven Siloti d48c835f65 add cmake package support
This enables libtorrent to be used with the find_package command for easy
integration with applications which use cmake.
2017-07-10 16:57:29 -07:00
Steven Siloti cba3ae4849 use target_* commands to configure msvc 2017-07-10 16:57:29 -07:00
Steven Siloti 41465678cd use target_* commands to configure exceptions 2017-07-10 16:57:29 -07:00
Steven Siloti 6343794900 remove kludge to set TORRENT_DEBUG 2017-07-10 16:57:29 -07:00
Steven Siloti 023ff527b7 remove unnecessary and inappropriate flags
Cmake already has reasonable defaults for these. In any case they represent
system or user level policy and should not be hard coded in the build script.
2017-07-10 16:57:29 -07:00
Steven Siloti 71e1924372 use target_compile_definitions
The add_definitions command appends to the properties of the current directory
which is usually not what you want. Using target_compile_definitions sets
the properties of the target and allows you to specify PUBLIC definitions which
should be propagated to dependent targets. This is similar to the usage
requirements property in boost build.
2017-07-10 16:57:29 -07:00
Steven Siloti 2ed51927bf remove obsolete disk-stats option 2017-07-10 16:57:29 -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
arvidn de90419712 merge RC_1_1 into master 2017-07-07 16:45:03 -07:00
arvidn 6425cfbc4f tests should not fail by failing to clean up. Make clean up more reliable on windows 2017-07-04 10:21:23 -04:00
Alden Torres 10bfe18ebe added consts and minor code formatting 2017-07-03 16:58:49 -04:00
Alden Torres 285daa21a5 fixed another shorten-64-to-32 warning in netlink code 2017-07-03 13:53:15 -04: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 fab8af6be2 don't depend on or define UNICODE and _UNICODE on windows 2017-07-02 11:05:53 -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
pavel.pimenov 7af38ba05a add const and static 2017-06-30 16:07:23 -04:00
pavel.pimenov 92a923134c fix generate_token 2017-06-30 13:22:30 -04:00
arvidn db09332a02 merged RC_1_1 into master 2017-06-30 08:58:21 -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
Alden Torres a78ec94184 fixed compilation warnings in enum_net netlink code 2017-06-29 15:48:28 -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
Arvid Norberg b13ac50f4e update libsimulator (#2107)
use move in simulations. don't pretend io_service to be movable
2017-06-28 11:00:14 -04:00
arvidn 506950001d fix regression where paused torrents could not have their queue position changed 2017-06-27 12:37:08 -04:00
Steven Siloti 20e05a12ac broadcast_socket: remove obsolete special case
enum_net_interfaces now fills in the scope_id correctly so there's no need for
a special case to set it here.
2017-06-27 08:09:20 -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
Steven Siloti 0a9e2c965d invert logic in read_nl_sock for better clarity and reliability (#2101)
The seq and pid parameter are apparently used as a safety check in case
a stream of netlink messages is not properly terminated. I initially thought
that they represented the expected values of the incoming messages.
Instead seq is set to one-past the expected value and the loop aborts when
seq and pid match the message.

Inverting the logic so that reading continues as long as the seq and pid match
the incoming messages is, to me at least, more intuitive. It is also more
reliable since it does not rely on the next seq being strictly sequential. It
also catches unexpected messages preceding or interleaved with the expected
messages.

There seems to be a lot of confusion all across the internet over the
nlmsg_pid field. The changes here were made based on examination of the
kernel source and iproute2 (a common user of netlink).

The kernel does not read nlmsg_pid at all for routing messages.
Iproute2 sets it to zero unconditionally so I changed this code to do the same.
2017-06-25 10:29:32 -04:00
arvidn 2b91b1070d merged RC_1_1 into master 2017-06-24 12:37:13 -04:00
Steven Siloti ec30a5e9ec fix out-of-bounds read in bdecode
Fixes #2099
2017-06-24 10:52:49 -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
arvidn 77cc2b4eea fix re-check issue after move_storage 2017-06-20 22:27:39 -04:00
Alden Torres 687e0ea4b4 added consts and minor auto refactor in upnp.cpp 2017-06-20 17:59:05 -04:00
Alden Torres 18eef80676 avoid runtime fail with wrong arguments in upnp::update_map (#2094) 2017-06-20 15:06:14 -04:00
Alden Torres f6ca04638c added const and auto refactor in torrent, piece_picker 2017-06-20 13:20:12 -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 523313e72d merged RC_1_1 into master 2017-06-17 11:41:06 -04:00
arvidn 0810793372 fix docs build on travis 2017-06-17 07:47:48 -04:00
arvidn b80c477733 merged RC_1_1 into master 2017-06-16 00:24:41 -04:00