Commit Graph

10907 Commits

Author SHA1 Message Date
arvidn 55a0a6e0df fix production asserts 2018-05-22 12:12:33 +02:00
Steven Siloti 92a7188163 only start a new accept request on new listen sockets
Existing sockets already have an outstanding accept.
Also fix mapping new listen sockets when re-mapping is not requested.
2018-05-22 11:06:33 +02:00
arvidn 1a66a8b285 merged RC_1_1 into master 2018-05-20 12:08:46 +02:00
arvidn c986d93913 fix properly ignoring failure to get local endpoint of a socket while printing an error 2018-05-20 10:47:46 +02:00
arvidn a137bbfdd4 simplify some using statements to pull in the address types 2018-05-20 08:46:14 +02:00
Steven Siloti 54f00ce09d don't change state to downloading if the torrent is finished
Move the transition to downloading after the torrent has been checked
for being finished. This prevents a spurious state_changed_alert when
adding a torrent which is already completed.

Also move the posting of the torrent_checked_alert to maintain the
historical ordering of that alert with respect to the transition out of
checking_resume_data.
2018-05-20 08:45:24 +02:00
d_komarov 5f74b6e353 Bump `file_error_alert` priority
This alert's priority must be higher than `block_downloading_alert`'s
to allow custom handling of file errors.

With progress notifications enabled, network thread might fully load
alerts queue, so file errors from disk thread won't have a chance to
be delivered.
2018-05-17 00:55:07 +02:00
Steven Siloti 9a48ef761e fix address of point-to-point interfaces (#3039) 2018-05-17 00:54:46 +02:00
d_komarov 96700c15ff Set http request timeout to 5 seconds
Fixes random test failures in test_http_connection.
2018-05-17 00:54:12 +02:00
Alden Torres 7621be6df1 fixed signed/unsigned warnings with latest version of Xcode clang (#3032) 2018-05-16 16:06:33 +02:00
Alden Torres a14d595eac minor code cleanup in torrent.cpp 2018-05-16 16:05:15 +02:00
Alden Torres a7b2026ef8 minor code refactor in ip_filter code 2018-05-14 23:58:01 +02:00
Eugene Shalygin 17e9ce9dfd Fix CMake targets names in the Config.cmake file.
This fixes error introduced by 44b5777be3
where this entry was forgotten.
2018-05-14 13:32:07 +02:00
Arvid Norberg f4d7ff592e merged RC_1_1 into master 2018-05-14 09:50:10 +02:00
Arvid Norberg ccdfd7383e move export.hpp into aux_ folder. put assert symbols in libtorrent namespace 2018-05-14 09:09:01 +02:00
Eugene Shalygin 44b5777be3 Make CMake export namespace to be consistent with library name
Use camel-cased library name "LibtorrentRasterbar" is used as namespace
name for exports and the import target in the find module.
2018-05-14 09:08:19 +02:00
Eugene Shalygin 5667b8f72c Borrow FindLibGcrypt.cmake from KTorrent project. 2018-05-14 09:08:19 +02:00
Eugene Shalygin 7f2ce2ba9e Rename targets and config files for consistency
CMake does check both suffixes anyway (-config and Config), but since
the project name is "libtorrent-rasterbar", the "-config" suffix looks
better.
2018-05-14 09:08:19 +02:00
Eugene Shalygin 8b87b42a5a Try to use config mode first while looking for the package 2018-05-14 09:08:19 +02:00
Eugene Shalygin a626f75c5e Refactor CMakeLists.txt
1. Replace custom 'shared' option with the standard BUILD_SHARED_LIBS
flag
2. Replace foreach() calls for source items with target_sources() and
generator expression $<JOIN:>.
3. Remove build types definition: makes no sense for
single-configuration generators, and is populated automatically for
multi-configuration ones.
4. Add feature summary
5. Enahnce compiler flags management for static runtime by utilizing functions
from the ucm project
6. Copy almost all options from the Jamfile.
7. If compiler supports C++14, use it.
8. Raise minimum required CMake version to 3.11 and drop bundled FindIconv.cmake
2018-05-14 09:08:19 +02:00
Eugene Shalygin 7e390b1ca7 Add tools to cmake build 2018-05-14 09:08:19 +02:00
Arvid Norberg 17055ad4d1 don't enable reuse-address for UDP sockets, as it will always succeed and not get any incoming packets. It's better to detect a port conflict and try a different port. Also implement port-retry logic for the UDP sockets 2018-05-13 22:36:02 +02:00
Steven Siloti 243353a144 account for partially downloaded pieces when announcing as a seed 2018-05-13 22:35:04 +02:00
arvidn fe612ca167 replace the TORRENT_CFG ABI check with inline namespaces around the symbol that can change ABI based on build configuration options 2018-05-13 19:25:17 +02:00
arvidn 9ca12d6db5 restore aspects of the previous behavior of force-proxy. Instead of not opening any TCP listen sockets at all, open them but reject any incoming connection. This is because in RC_1_1, the UDP and TCP sockets are tied in subtle and unintuitive ways. This is much cleaner in the next major release and this patch will not need to be merged 2018-05-13 12:31:00 +02:00
arvidn 86f88dc90d merger RC_1_1 into master 2018-05-13 12:28:50 +02:00
Arvid Norberg 4523e05527 fix uTP and SOCKS5 simulations and update libsimulator 2018-05-13 12:10:34 +02:00
arvidn 8bb1cd2b46 merged RC_1_1 into master 2018-05-12 15:37:53 +02:00
d-komarov f052d1ca40 Fix bandwidth allocation (#2810)
Don't allow peer connection to ask quota from bandwidth manager if send buffer is empty.
Remove undefined member function
Update download rate multiplier
2018-05-12 13:53:03 +02:00
arvidn ddd1168296 don't attempt to make uTP connections if we don't have any outgoing UDP sockets 2018-05-12 13:34:58 +02:00
arvidn 4d17e0132e fix empty outgoing interfaces for UDP sockets 2018-05-12 13:34:58 +02:00
Arvid Norberg 90e82152b0 back-port fixes to Jamfile from master 2018-05-12 13:24:10 +02:00
Arvid Norberg c98b700d4f merged RC_1_1 2018-05-10 22:48:39 +02:00
Steven Siloti 8fdba2aa39 don't specialize standard type trait is_integral
Concerning type traits, the C++ standard states: "The behavior of a program
that adds specializations for any of the templates defined in this subclause is
undefined unless otherwise specified."

There is no exception for is_integral.
2018-05-10 19:06:18 +02:00
arvidn a2c6136f44 add round-trip test to create_torrent 2018-05-10 19:04:26 +02:00
arvidn 299a545648 add test for suggests- and seed mode combined 2018-05-10 17:40:23 +02:00
arvidn fe25b50b1a update libsimulator with a fix for boost-1.66 2018-05-10 14:04:10 +02:00
arvidn 5f758b8531 remove redundant set_piece_hashes template. take a std::function instead 2018-05-10 12:10:33 +02:00
Steven Siloti 96d215a32a only allow pinged nodes into the routing table (#3006)
This is an attempt to prevent bogus nodes entering the routing table and
being propogated to other nodes.
2018-05-08 12:47:29 +02:00
Eugene Shalygin 81fd09775c Fix compilation with GCC 8 2018-05-07 13:33:18 +02:00
d-komarov dc28c96559 Fix unit tests build
Export `recursive_mutex` because `emplace_alert` template injects
dependency on that type during instatiation.
2018-05-07 00:53:48 +02:00
Arvid Norberg 894933e1f1 fix typo in comment 2018-05-06 20:59:32 +02:00
Arvid Norberg 4b368e1cfc merged RC_1_1 into master 2018-05-02 01:57:41 +02:00
arvidn 8808eb7cdd introduce a recursive mutex to protect the alert_manager, and hold the mutex while calling user callbacks and plugin hooks. This is required to ensure the underlying storage for alert allocations (in the stack allocators) is synchronized with the thread that may be accessing it 2018-05-01 23:17:51 +02:00
Alex Hirsch 168ec6b516 Use _CFLAGS_OTHER for compiler definitions
`PC_LIBTORRENT_RASTERBAR_CFLAGS` not only gives you the definitions, but
also includes the include path flags (`-I...`).

This causes problesm when passing the result to
`target_compile_definitions`. The resulting compiler command would then
look something like this:

    /usr/bin/c++   -D-I/home/...

This change uses `PC_LIBTORRENT_RASTERBAR_CFLAGS_OTHER` instead which
does not contain the include path flags.
2018-05-01 23:11:58 +02:00
Alden Torres 8da635d1f5 minor code cleanup, more use of const 2018-05-01 23:03:29 +02:00
Arvid Norberg 26b0487f0b merged RC_1_1 into master 2018-05-01 21:26:42 +02:00
d-komarov 785f173df3 Revise alert priorities / torrent::on_resume_data_checked issue (#2962)
Most status alerts should have priorities above normal level. Good reason for this is resume data verification case. For a large torrent(having lots of pieces) whole alert queue will be overflowed
with a `piece_finished_alert` right after resume data has been verified. Thus alerts like `torrent_checked_alert`, `torrent_finished`, `state_changed_alert` will not go the alerts queue.
* Introduce alert_priority enumeration
* Bump state_changed_alert's priority
* Set dht_direct_response_alert priority to `critical`
2018-05-01 12:26:37 +02:00
Alden Torres cb8b32f353 revert to use Boost variables in CMakeLists.txt 2018-05-01 10:50:21 +02:00
Alden Torres 377e800e72 fixed conversion warnings in 32 bits 2018-04-30 23:09:00 +02:00