Commit graph

191 commits

Author SHA1 Message Date
Joakim Frostegård
bbc351bb59 Update privdrop to 0.5 2021-02-10 18:36:23 +01:00
Joakim Frostegård
ac6eefc30f Update crossbeam-channel to 0.5 2021-02-10 18:36:23 +01:00
Joakim Frostegård
fe11ed138a Use (patched) crates.io deps for crates, add some package metadata 2020-09-13 17:30:26 +02:00
Joakim Frostegård
66e9882f48 Update dependencies 2020-09-10 23:23:21 +02:00
Joakim Frostegård
8f72445b93 aquatic_http: fix debug log message for when TLS is established 2020-08-17 21:50:35 +02:00
Joakim Frostegård
4e0fc68548 aquatic http and ws: when cleaning torrents, update statistics 2020-08-16 23:24:44 +02:00
Joakim Frostegård
3d35bd9bd4 aquatic http and ws: raise default max peer and connection age
There was a problem with aquatic_http with clients announcing
less often than requested interval and getting purged, making
file transfers less reliable
2020-08-16 23:24:29 +02:00
Joakim Frostegård
6ee8ed4895 aquatic_common: extract response peers: don't return sender
Seems to fix or at least help with some issues with
real clients being slow to initiate transfers
2020-08-16 23:07:39 +02:00
Joakim Frostegård
b5452c2954 aquatic_http: debug-log responses in full 2020-08-16 21:15:05 +02:00
Joakim Frostegård
88423976c4 aquatic_http, aquatic_ws: add option for printing statistics
statistics are on number of peers per torrent
2020-08-13 03:58:28 +02:00
Joakim Frostegård
2b4cd2dea1 aquatic_http: support multiple request workers 2020-08-13 01:50:18 +02:00
Joakim Frostegård
9efc1fc66a add aquatic crate with master executable, refactor cli_helpers 2020-08-13 00:13:01 +02:00
Joakim Frostegård
cce7bd7150 aquatic_http: send responses for each event, use mio poll waker
This means
* less fluctuation in number of responses send per second
* longer poll timeouts can be used since poll is woken when
  responses are available for sending
* drain-like method used to fetch responses from response
  channel, meaning responses added while iterating won't
  be processed
2020-08-10 02:53:15 +02:00
Joakim Frostegård
d9282defbc aquatic_http: deregister connections before removing them 2020-08-09 02:30:40 +02:00
Joakim Frostegård
2893fffd20 aquatic_http: use const LISTENER_TOKEN for clarity 2020-08-09 00:44:39 +02:00
Joakim Frostegård
2d3761fee2 impl Copy for LogLevel, remove some cloning 2020-08-09 00:27:05 +02:00
Joakim Frostegård
8d58f8bb70 init logger in aquatic_cli_helpers crate 2020-08-02 21:21:58 +02:00
Joakim Frostegård
427c0bc7c3 aquatic_http: add keep_alive setting (default true)
This might be good for performance in the real world. It also
enables fairer load test comparisons with opentracker, which
in my understanding drops connections after sending responses.
2020-08-02 20:06:49 +02:00
Joakim Frostegård
c8b94adab5 aquatic_http: remove Connection.shutdown fn 2020-08-02 19:26:12 +02:00
Joakim Frostegård
cb3ec8cbf1 WIP: get http load test into better (but bad) state
Is now able to maintain correspondence with aquatic_http
and opentracker
2020-08-02 06:38:36 +02:00
Joakim Frostegård
e7de66603e aquatic_http: add upper limit on request read buffer 2020-08-02 02:45:56 +02:00
Joakim Frostegård
a3a1d1606b WIP: udp: add ipv6 support
Returning IPv6 peers doesn't really work with UDP. It is not supported by
https://libtorrent.org/udp_tracker_protocol.html. There is a suggestion in
https://web.archive.org/web/20170503181830/http://opentracker.blog.h3q.com/2007/12/28/the-ipv6-situation/
of using action number 4 and returning IPv6 octets just like for IPv4
addresses. Clients seem not to support it very well, but due to a lack of
alternative solutions, it is implemented here
2020-07-31 05:37:58 +02:00
Joakim Frostegård
fd68a5f603 aquatic_http: serialize responses to a buffer ref instead of new vec
This improves benchmark performance somewhat and performance
during load testing a bit too.
2020-07-24 21:59:23 +02:00
Joakim Frostegård
228511b3aa aquatic_http: replace flume with crossbeam; clean connections less often 2020-07-24 20:36:46 +02:00
Joakim Frostegård
f1f708465a remove aquatic_common_tcp crate, move contents into aquatic_http
It doesn't make a lot of sense to make a separate crate for
the few things here. I don't really want tight coupling between
the crates anyway, since it impedes making changes in them
and makes understanding them more difficult.
2020-07-21 23:01:34 +02:00
Joakim Frostegård
f2db4a43b9 Update lots of dependencies 2020-07-21 00:58:56 +02:00
Joakim Frostegård
95e25710dc aquatic_http: move request parsing into protocol crate 2020-07-20 20:13:56 +02:00
Joakim Frostegård
19ee41eb72 aquatic_http: config: set poll timeout in microseconds, default to 10000 2020-07-20 15:46:17 +02:00
Joakim Frostegård
4ac2012a2a aquatic_http: move protocol module to new crate aquatic_http_protocol 2020-07-19 21:59:31 +02:00
Joakim Frostegård
4caf174da5 aquatic_http: add criterion benchmark for announce response to bytes
Speedup of custom implementation compared to using bendy:

announce-response-to-bytes:

time:   [413.77 ns 415.34 ns 417.08 ns]
change: [-93.074% -93.021% -92.968%] (p = 0.00 < 0.01)
Performance has improved.
2020-07-19 16:56:13 +02:00
Joakim Frostegård
9df1f0ecc6 aquatic_http: rewrite request parsing, use smartstring
Use smartstring in PeerMapKey too.

Improves benchmark speed.

request-from-path:

time:   [2.1484 us 2.1530 us 2.1586 us]
change: [-24.246% -23.908% -23.570%] (p = 0.00 < 0.01)
Performance has improved.
2020-07-19 15:38:26 +02:00
Joakim Frostegård
fc9b4c8e0d aquatic_http: protocol: add test for scrape request parsing 2020-07-19 14:28:48 +02:00
Joakim Frostegård
12a62f5df4 aquatic_http: add test for announce request parsing 2020-07-19 14:23:48 +02:00
Joakim Frostegård
54e801c6a9 aquatic http: request from path: whitelist url keys for security
This way, the non-ddos-resistant hashmap hasher can be kept. Also
improves performance, probably simply because less hashing work
is done:

time:   [2.8050 us 2.8156 us 2.8274 us]
change: [-22.940% -22.412% -21.916%] (p = 0.00 < 0.01)
Performance has improved.
2020-07-19 13:46:36 +02:00
Joakim Frostegård
b17c9999f0 aquatic_http: request from path: remove from map to avoid some clones
change: [-3.8362% -3.2346% -2.5437%] (p = 0.00 < 0.01)
Performance has improved.
2020-07-19 13:24:48 +02:00
Joakim Frostegård
ca8d278a03 aquatic_http: parse_key_value_pairs_memchr: small code improvement 2020-07-19 13:06:39 +02:00
Joakim Frostegård
a8e355f22a aquatic_http: add criterion benchmarks for request from path parsing
About 35% improvement by using both memchr methods
2020-07-19 01:58:41 +02:00
Joakim Frostegård
9b0956cc91 aquatic_http: Request::from_http_get_path: add memchar query str parser 2020-07-18 18:40:27 +02:00
Joakim Frostegård
84facea0ca aquatic_http: add hand-written ScrapeResponse serialization 2020-07-18 17:46:16 +02:00
Joakim Frostegård
81708e0adc aquatic_http: add manual bencoding for announce and failure responses
This is more performant
2020-07-18 16:28:42 +02:00
Joakim Frostegård
056cd41732 aquatic_http: add memchr version of urldecode, which might be faster 2020-07-18 06:05:13 +02:00
Joakim Frostegård
f94c52da77 aquatic_http: send_response: use itoa and Vec::with_capacity
This leads to fewer allocations and possibly better performance.
2020-07-18 03:05:40 +02:00
Joakim Frostegård
8ddccb20aa aquatic_http: use new trait Ip for ip generic parameters 2020-07-08 14:22:30 +02:00
Joakim Frostegård
2386dd0e8b aquatic_http: parameterise many data structures over peer IP protocol 2020-07-08 14:13:10 +02:00
Joakim Frostegård
da4ba14b47 aquatic_http: EstablishedConnection.send_response: fix small bug 2020-07-08 12:28:46 +02:00
Joakim Frostegård
43a33d80c4 aquatic_http: add ipv6 compact responses; fix ipv4/ipv6 issue 2020-07-08 12:26:41 +02:00
Joakim Frostegård
c53c3928ab aquatic_http: fix clippy error, or at least log possible error 2020-07-05 20:33:24 +02:00
Joakim Frostegård
b65297195a aquatic_http, aquatic_common_tcp: fix some clippy warnings 2020-07-05 20:22:03 +02:00
Joakim Frostegård
8269ae2994 aquatic_http: remove (no longer used) dependency serde_urlencoded 2020-07-05 19:50:52 +02:00
Joakim Frostegård
76a340574e aquatic_http: debug log StreamEnded, keep connection on parse error 2020-07-04 19:38:37 +02:00