Commit Graph

6637 Commits

Author SHA1 Message Date
arvidn 93bb84d94c some random cleanup 2017-09-13 08:28:46 +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
Alden Torres a86bc767de minor cleanup and code refactor in web_peer_connection.cpp (#2322) 2017-09-10 08:52:31 +02:00
Alden Torres 7cc2619aad more use of auto and minor code refactor in routing_table.cpp 2017-09-08 08:49:06 +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 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
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 24d08cdf82 fix protocol_str in portmap_alert 2017-09-02 10:39:55 +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
Alden Torres ac914d4415 avoid port mapping of local addresses (#2296) 2017-09-01 19:28:27 +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 fe09ca9b97 more use of auto, const and minor cleanup in session_impl.cpp 2017-08-30 20:30:06 +02:00
Steven Siloti 621da10e60 hold an owning reference to storage objects in try_flush_write_blocks
It is possible for all other references to a storage object to be
destroyed while try_flush_write_blocks is running. If the storage is
destroyed then find_piece will crash when trying to re-aquire the
shared_ptr. To prevent this, keep the storage alive by holding a
shared_ptr to it in try_flush_write_blocks.

Normally the fence job when stopping a torrent would prevent the storage
object from being destroyed until all flush jobs are complete.
try_flush_write_blocks can be run after every disk job though so it has
the potential to "stradle the fence".

If the associated torrent does get unloaded then it is expected that
find_piece will return NULL thus causing the entry to be ignored.
2017-08-30 12:45:06 +02:00
Alden Torres d0ea585859 minor code optimization in broadcast_socket.cpp 2017-08-29 22:29:11 +02:00
Steven Siloti 52ccad23b9 read_piece: handle failure to allocate piece buffer 2017-08-29 12:24:17 +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 d4986f878f treat unique local addresses as local
These addresses are not globally routable so they should be considered local.
2017-08-28 11:34:47 +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 1ce4089229 log failures to parse interface and node lists from settings 2017-08-24 07:59:22 +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 1290e6f5af simplify buffer handling in rc4_decrypt calls 2017-08-23 07:01:12 +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 5130827fc7 minor code refactor and cleanup in bt_peer_connection (#2261) 2017-08-21 11:00:00 +02:00
arvidn d59d394d5b remove residual mentions of mtu for interfaces 2017-08-20 22:34:20 +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
Steven Siloti 73e898e38e disable disk cache pool allocator by default
The pool allocator has known issues with not releasing memory when it should
and is of dubious benefit.

See #2251
2017-08-18 09:39:24 +02:00
Alden Torres 070066e892 more use of emplace_back and minor code simplification 2017-08-17 08:08:51 +02:00
arvidn 05b5b4ef4d merged RC_1_1 into master 2017-08-16 22:46:47 +02:00
arvidn b5fe0f95a2 fix issue in UTF-8 encoding validation 2017-08-16 13:15:19 +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
Alden Torres 6a3be6cfd3 minor trivial code optimization 2017-08-15 23:30:28 +02:00
arvidn fcb9c7b6f3 fix invalid read in parse_int() in bdecode_node() and lazy_bdecode() 2017-08-15 00:01:37 +02:00
Alden Torres 48de05ba82 lint-based code review in utp related code 2017-08-13 07:49:43 +02:00
Steven Siloti 50c2aee8ec don't create web seed connections if the torrent is upload only
The fix in 9a63d4696e was imcomplete.
It turns out disconnect_if_redundant decrements the connection count
which unballances the count if we do end up disconnecting the peer.

This change avoids the problem by checking if the torrent is
upload only much sooner, before the connection object is even created.
We still do a redundancy check just-in-case, but it is not expected to
trigger.
2017-08-11 08:16:00 +02:00
Alden Torres 0ac01a8532 header fix for use of stringstream 2017-08-10 22:02:10 +02:00
arvidn 5f4816f1d8 fix include in http_connection.cpp 2017-08-10 19:47:42 +02:00
arvidn 865ff09a84 merge RC_1_1 into master 2017-08-10 16:44:57 +02:00
arvidn 560ef29276 fix issue with very long tracker- and web seed URLs. Instead of using a fixed length stack allocated request buffer, use a dynamically growing stringstream 2017-08-10 14:01:11 +02:00