Commit Graph

143 Commits

Author SHA1 Message Date
Dirkjan Ochtman 2c6aa43610 Apply clippy suggestions from Rust 1.66 2022-12-19 10:13:01 -08:00
StygianLightning 0d366990f1 Removed an obsolete lint control annotation.
The lint issue that made the workaround necessary has been resolved.
2022-12-10 11:07:03 -08:00
StygianLightning b170993bd1 Fixed a typo. 2022-12-10 11:07:03 -08:00
Benjamin Saunders 641114a69d Fix clippy lints 2022-11-14 01:17:22 -08:00
Benjamin Saunders 7d51d2e57e Remove Incoming stream in favor of Endpoint::accept 2022-10-23 08:18:42 +02:00
Benjamin Saunders 6e4bcbb2fc Drop NewConnection in favor of simpler API 2022-09-27 11:08:26 +02:00
Benjamin Saunders fe93a68108 Replace structopt with its successor, clap 3 2022-07-03 21:02:33 +02:00
François Garillot f731019c83 Clean up a few Option/Result patterns that fit an std combinator 2022-01-29 13:00:48 -08:00
Benjamin Saunders f91f74610c Update example README output samples 2022-01-01 21:36:29 +01:00
Benjamin Saunders 19b58cc948 Drop futures-util dev-dependency
This wasn't serving any purpose we couldn't more readably accomplish
with async/await.
2021-12-29 07:34:22 +01:00
Benjamin Saunders 7ed94be3e4 Provide inherent next methods on streams
Allows for convenient use in async blocks by downstream code without a
futures_util dependency.
2021-12-21 07:03:27 +01:00
Benjamin Saunders 5822ff3781 Fix ALPN misconfiguration in example
Introduced by a copy-paste error in
9daaa15da2
2021-12-10 10:16:53 +01:00
Benjamin Saunders 1159ae3c65 Non-exhaustive ClientConfig 2021-11-10 11:25:19 +01:00
BiagioFesta 25d9a40bf9 followup: rename "stateless retry" -> "retry"
Fix compile error in quinn-proto after field rename
2021-11-06 13:11:56 +01:00
Benjamin Saunders b923c4c8b0 Pass SocketAddr by value
We always consume this by value in the end, and it's a little more
ergonomic.
2021-10-29 20:12:45 +02:00
Benjamin Saunders 5d1b6a101b Remove EndpointBuilder
Now that rustls configuration is more straightforward, this is not
adding significant value.
2021-10-29 20:12:45 +02:00
Benjamin Saunders 34ca6cff61 Privatize crypto config helpers
We're now sufficiently compatible with rustls defaults that these
aren't worth the API surface area.
2021-10-29 08:02:13 +02:00
Benjamin Saunders 495d2927cb Remove certificate newtypes 2021-10-29 08:02:13 +02:00
Benjamin Saunders 4927355049 Remove config builders
These aren't significantly more convenient than working with rustls
directly at this point.
2021-10-27 17:49:48 -07:00
Benjamin Saunders a384ee2edb Erase crypto::Session::HandshakeData 2021-10-27 17:49:48 -07:00
Dirkjan Ochtman 9daaa15da2 Upgrade to rustls 0.20 2021-10-26 11:05:30 -07:00
Dirkjan Ochtman fed3c5cb39 Require explicit construction of ServerConfigs 2021-09-29 10:12:44 -07:00
Dirkjan Ochtman a7efd92044 Require explicit construction of ClientConfigs 2021-09-29 10:12:44 -07:00
Chris Connelly e63dd77376 Make TransportConfig setters infallible
For most setters this was just a case of changing the signature to take
a `VarInt`.

`max_idle_timeout` was a bit more involved in order to maintain a usable
conversion from `Duration`. The internal representation was changed from
`Duration` from `VarInt`, and an `IdleTimeout` newtype was introduced
for the setter signature. `IdleTimeout` contains a `VarInt`-encoded
millisecond value, and has a fallible conversion from `Duration`. The
use of a newtype is preferable to a direct `Duration` -> `VarInt`
encoding since there could be other `VarInt`-encoded values in future
that use a different resolution than milliseconds.

These changes allow callers to avoid the type-level possibility of error
if they have a `VarInt` (or a value that can be converted infallibly
into one). Fallible conversion from `VarInt` is still convenient with
`TryInto`, and callers can handle the conversion errors without the
indirection of `ConfigError`.

Closes #1176.

BREAKING CHANGE: The `max_concurrent_bidi_streams`,
`max_concurrent_uni_streams`, `stream_receive_window`, and
`receive_window` methods on `TransportConfig` now take `VarInt`
arguments and return `&mut Self`. `TransportConfig::max_idle_timeout`
now takes an `IdleTimeout` argument and returns `&mut Self`.
2021-09-19 18:30:43 -07:00
Marcel Märtens b224d1d0fa switch to futures_utils in tests and benches, also use futures_utils isntead of futures_core 2021-08-11 10:27:32 +02:00
Dirkjan Ochtman d78b3187a9 Apply clippy suggestions from Rust 1.54 2021-07-30 13:29:32 -07:00
Benjamin Saunders 14813d33c2 Remove unintentional, obfuscatory use of Result::into_iter 2021-03-21 22:27:17 +01:00
Benjamin Saunders 612c9ac2b8 Remove unnecessary dropping in client/server examples 2021-01-26 06:46:32 +01:00
Benjamin Saunders 03de1d0374 Ensure graceful close in client example 2021-01-26 06:46:32 +01:00
Benjamin Saunders 1e5a538221 Limit concurrent streams rather than accept queue size
Previously, we limited the number of streams that could be opened by
the peer but not `accept`ed by the application. However, to guarantee
bounded resource use, applications will typically want to limit the
number of streams they process concurrently. While this could
be *approximately* implemented at the application layer by controlling
calls to accept, that approach has a significant drawback: If streams
are slow to process, the worst-case per-stream latency observed by a
peer who opens the maximum number of streams can be arbitrarily bad,
because streams may be opened above the limit the local application is
willing to process. Reducing the number of unaccepted streams
tolerated can reduce the proportion of streams affected, but reducing
it too low will increase the number of round trips required to open
any given number of streams, increasing average latency significantly.

As a side benefit, this reduces the effort needed for applications to
limit concurrency to a fixed quantity, which is expected to be the
overwhelmingly common case. Should a use case for dynamic concurrency
limits arise, we can expose a setter.
2021-01-22 11:39:00 -08:00
Dirkjan Ochtman 17fe82b598 Apply clippy fixes for 1.49 2021-01-01 11:16:05 -08:00
Benjamin Saunders 4e6f946423 Clarify example path behavior 2020-12-22 07:42:34 +01:00
Benjamin Saunders a92e070fab Note address family gotcha 2020-12-22 07:42:34 +01:00
Benjamin Saunders 36de1c2385 Fix errors in example README 2020-12-22 07:42:34 +01:00
Dirkjan Ochtman 4420b61aaa quinn: print socket addresses in example client/server 2020-12-11 16:17:48 -08:00
Luca Barbato fc2016103d Fix a typo 2020-12-04 10:30:40 +01:00
Timon 83cff80908 Create example README (#910) 2020-11-15 21:43:28 +01:00
Matthias Einwag 4c9c0dc3c6 Use vectors instead of boxed slices
Use vectors instead of boxed slices

The conversion from Vec<u8> into Box<[u8]> is not always for free.
It will call `Vec::into_boxed_slice`, which will call `shrink_to_fit`.
https://github.com/rust-lang/rust/blob/28f03ac4c08fc7ec62428d0b914e1510ce7ee2cb/library/alloc/src/vec.rs#L689

If the `Vec` isn't fully utilized before, this will cause a reallocation
and a copy of all data. This might currently happen with every
outgoing packet.

This change simply keeps things as `Vec<u8>`, which works just fine since
the IO layer can deal with it.
2020-10-31 10:27:00 -07:00
Dirkjan Ochtman d5b47f601d Unwrap unused results from invalid config values 2020-10-12 12:13:50 -07:00
DelusionalOptimist 751d660343 Fixed typo in quinn/examples/connection.rs 2020-09-09 16:42:35 +02:00
Dirkjan Ochtman f212256435 Clean up warnings/errors 2020-09-03 09:17:32 -07:00
Benjamin Saunders a1e8c56cb0 Update initial salt, retry integrity key/nonce, and versions 2020-06-30 08:57:14 +02:00
Dirkjan Ochtman 5484d37c76 Migrate to directories-next
directories is no longer being maintained and the final released version
causes a dependency conflict (cfg-if, versus tracing).
2020-06-22 14:46:13 +02:00
Benjamin Saunders 128c1b2a5e Decouple ClientHello data from peer identity
These are determined at different times for incoming connections, so
bundling them together was fairly ugly.
2020-06-07 14:42:16 +02:00
Benjamin Saunders ca689d33d6 Update version numbers for draft 28 2020-05-25 06:22:35 +02:00
Jesse Lucas 11a7c77992 Add usage documentation to quinn/examples/server.rs 2020-04-25 18:06:04 +02:00
Benjamin Saunders cbb3470c7e Update draft number 2020-03-08 12:04:26 -07:00
Dirkjan Ochtman 6cca808d14 Make rustls an optional dependency for quinn 2020-03-07 12:12:01 -08:00
Dirkjan Ochtman 0a4bca7049 Remove old authentication data APIs 2020-03-07 12:12:01 -08:00
Benjamin Saunders 31fabfe807 Fix panic in connection example 2020-02-27 07:05:37 +01:00