Commit Graph

10889 Commits

Author SHA1 Message Date
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
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 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
Alden Torres 3b412f5ab8 avoid warnings in Jamfile due to unescaped special characters 2018-04-30 23:07:14 +02:00
Eugene Shalygin 4afa4932df Add required dependencies to the generated package Config.cmake file 2018-04-29 19:48:26 +02:00
Eugene Shalygin 63229dbda6 Properly select release build with CMake for AppVeyor 2018-04-29 19:48:26 +02:00
Eugene Shalygin 3c6e0b2578 Generate proper pkg-config file in cmake build 2018-04-29 19:48:26 +02:00
Eugene Shalygin 049e918295 build python bindings with cmake 2018-04-29 19:48:26 +02:00
Eugene Shalygin 55e2b23255 Add workaround for MSVC and snprintf define 2018-04-29 19:48:26 +02:00
Arvid Norberg 07ff024e30 fix conversions of resume_data field of save_resume_data_alert. make write_resume_data_buf return a byte-array. use write_resume_data_buf() in client.py instead of, the deprecated, resume_data 2018-04-29 16:33:09 +02:00
Steven Siloti ec18742f8e save the number of idle threads locally in disk_io_thread_pool::thread_active
This cuts down on the number of atomic loads while also being more correct.
Before it was possible for m_num_idle_threads to increase before its value
could be stored in m_min_idle_threads.
2018-04-29 16:31:18 +02:00
Arvid Norberg fc56ec194a merge RC_1_1 into master 2018-04-29 15:07:26 +02:00
arvidn 33bf3c827f fix deprecation markups 2018-04-28 22:47:38 +02:00
Arvid Norberg 747fcb633a fix typo in client.py. introduce parse_magnet_uri_dict to python binding (returning a dict) in preparation for next major version that will release an add_torrent_params object 2018-04-28 19:05:23 +02:00
Eugene Shalygin 927647acc5 Add options to specify network interfaces to client.py 2018-04-28 15:55:28 +02:00
arvidn 8621477239 merged RC_1_1 into master 2018-04-28 14:36:24 +02:00
Steven Siloti f5e33932d2 fix use after free in flush_range and flush_iovec
Calling blocks_flushed can cause the piece entry to be freed so its
callers need to be aware of that and avoid dereferencing the pointer if
the entry is freed.
2018-04-27 16:15:19 +02:00
Arvid Norberg 366b7983d1 fix typo with bind_outgoing_socket~ 2018-04-26 19:50:25 -04:00
pavel.pimenov 2a97ec6e0e Windows: Fix build Visual C++ ARM/ARM64 2018-04-25 16:07:47 -04:00
Alden Torres 0ec66e9024 fix disk_io_thread::do_check_fastresume storage initialize logic from RC_1_1 merge 2018-04-25 16:04:20 -04:00
Alden Torres 83dd6c9c53 cleanup and refactor in storage source code 2018-04-25 16:02:30 -04:00