Commit Graph

334 Commits

Author SHA1 Message Date
ssebo c0eaab79bb fix iOS setsockopt invalid params 2020-09-12 11:03:35 +02:00
Dirkjan Ochtman f212256435 Clean up warnings/errors 2020-09-03 09:17:32 -07:00
Imbris 35db51eb1a Reexport ReadUnordered 2020-08-23 20:41:33 +02:00
Alexander Jackson 80653da2ca Add documentation links to improve navigation
Add documentation links and references to some of the main parts of the API so
that relevant structs, enums and methods can be navigated to more quickly. This
reduces the need for the search bar and thus makes it easier to find related
content wherever it is mentioned.
2020-07-06 09:46:06 +02:00
Charles Hall 66f3c04814 add a way to get a static id for a quic connection
Since remote IP addresses can change, it's useful to have an independent
ID for a connection that is always the same.
quinn_proto::ConnectionHandle provides a mechanism for this, but
quinn::Connection has an Arc internally whose internal pointer can be
used as a unique identifier since acquiring the ConnectionHandle would
require locking a mutex.
2020-06-25 22:35:28 +02:00
Charles Hall 73fb027357 expose StreamId information from Send/RecvStream
If nothing else, this should make it easier to track goings-on in
streams in client code since they'll be able to easily distinguish
between streams via StreamId::index().
2020-06-25 22:35:28 +02:00
Benjamin Saunders 563069e18c Signal ALPN/SNI availability during handshake
Allows processing of 0-RTT data sensitive to ALPN/SNI.
2020-06-07 14:42:16 +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 bfa8782485 Encapsulate coupling of connection driver and Connecting future 2020-06-07 14:42:16 +02:00
Benjamin Saunders 605a5a5f19 Style tweak 2020-06-01 11:52:34 +02:00
Benjamin Saunders df390ddf07 Remove transport-layer implicit reset on stop
Defers responsibility for closing send streams to the
application. This simplifies the stream lifecycle, because we no
longer need to track whether a stop was observed in a write error and
potentially free stream state after returning one. Fixes a stream
state leak for applications which don't necessarily observe write
errors.
2020-06-01 11:52:34 +02:00
Benjamin Saunders fe10e89409 Return a read error on ordered-after-unordered reads 2020-05-29 16:04:52 +02:00
Jean-Christophe BEGUE 58a3c057c4 Stopped event for SendStream 2020-05-29 15:22:26 +02:00
Dirkjan Ochtman 01bb2f1162 Clarify documentation on setting up mTLS (fixes #772) 2020-05-27 18:53:52 -07:00
Benjamin Saunders d92a567034 Return UnknownStream from Connection::reset for closed/reset streams
Improves consistency with other stream interfaces. H3 logic was
updated to ignore errors to preserve existing behavior, but future
work might want to insert some unwraps there if static correctness
guarantees are available.
2020-05-23 19:08:46 +02:00
Benjamin Saunders cd63774c0b Don't reference a hidden interface in documentation 2020-05-23 19:08:46 +02:00
Benjamin Saunders eea76d2a90 Proactively discard data on stopped streams
Previously, flow control credit would not be issued for data received
on stopped streams unless the application continued reading them
indefinitely. This produced a flow control leak in the high level API,
causing applications which dropped streams with unread data to
eventually grind to a halt.

Discarding data immediately should also improve performance when data
is being received on stopped streams, and allows us to discard stream
state earlier.
2020-05-21 09:28:42 +02:00
Benjamin Saunders 7053c6a802 Wake connection driver on read to issue flow control credit 2020-05-20 12:52:34 +02:00
Benjamin Saunders 54f0ab1b14 Clarifying comments 2020-05-12 20:59:13 +02:00
Benjamin Saunders 6786b8a1bb Include ReadError in ReadToEndError::Read display
By treating the read error as a component of, rather than an
incidental ancestor to, the enclosing error we reduce the odds of
unhelpful diagnostics.
2020-05-11 13:53:23 -07:00
Benjamin Saunders 30b42c5bcf Don't use a larger receive buffer than necessary 2020-05-11 22:29:36 +02:00
Benjamin Saunders 0247c7d644 Improve endpoint construction docs 2020-05-11 15:40:32 +02:00
Benjamin Saunders 6f9e20cf64 Allow a custom ClientConfig without allocating a default 2020-05-11 15:40:32 +02:00
Benjamin Saunders b727b7b605 Clarify soundness requirements for cmsg helpers 2020-05-11 10:21:13 +02:00
Benjamin Saunders 6ac08773a6 Update libc 2020-05-08 07:09:25 +02:00
stammw 34c9f45802 H3: HttpBody server integration in SendResponse 2020-05-04 17:59:05 +02:00
Dirkjan Ochtman 682c5863d5 Introduce separate StreamEvent enum 2020-04-28 13:06:10 -07:00
Dirkjan Ochtman f6904d6140 Apply suggestions from clippy 2020-04-25 09:43:13 -07:00
Benjamin Saunders ddc8d432e6 Fix broken doc link 2020-04-22 06:58:01 +02:00
stammw f540176e99 Make it easier to enable 0-RTT / TLS early data 2020-03-23 12:40:32 +01:00
stammw 76efa13cbd Ignore meaningless accepted_0rtt on server.
So `check_0rtt()` doesn't fail when called after handshake completed on server.
2020-03-23 12:40:32 +01:00
stammw 852bd26b45 Let the user know if an incoming bi is 0-RTT 2020-03-23 12:40:32 +01:00
Benjamin Saunders b73bb8553a Push remaining non-timeout Instant::now call downward 2020-03-17 07:08:36 +01:00
Benjamin Saunders 019ed88891 Fix busy-hang when tokio and proto disagree on timer expiry
Obtaining a fresh `now` on every iteration ensures that if tokio
checks timer completion using a later time than we do, we'll
eventually catch up and deem it expired as well rather than infinitely
restarting it.
2020-03-17 07:08:36 +01:00
stammw 7479181263 Let the user get requested ALPN on connecting 2020-03-16 20:55:03 +01:00
Benjamin Saunders a57b44eac3 Delete spurious syntax 2020-03-10 09:19:38 +01:00
Benjamin Saunders e2618ef99a Reject application datagram sends on closed connections 2020-03-09 12:54:43 -07:00
Benjamin Saunders fba42cb2a5 Reject stream writes on closed connections
Helps applications detect an error earlier and with less buffer space
consumed.
2020-03-09 12:54:43 -07:00
Benjamin Saunders d806cf6715 Fix spurious error when finishing while peer closes the connection
If the peer acknowledges the stream FIN and the the Finish future
isn't polled between then and the connection becoming
closed (guaranteed to be the case if the ACK and the CONNECTION_CLOSE
are in the same packet, which is common) then the Finish future would
yield an error even though the stream is guaranteed to have been
finished.
2020-03-09 12:43:44 -07:00
Benjamin Saunders 7a3b4559bb Disable IP fragmentation on Linux 2020-03-08 12:04:26 -07:00
Benjamin Saunders a4fea5a7fd Rename idle_timeout to max_idle_timeout to reflect semantics 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 666878f908 Make quinn crate types generic over proto::crypto::Session 2020-03-07 12:12:01 -08:00
Dirkjan Ochtman 7253fe892e Move TLS client config defaults into quinn-proto
The default client config setup contains low-level rustls code that is
better off in quinn-proto. This also makes the OS store roots and
certificate transparency easily available to quinn-proto users, and
makes it easy to use them by using Cargo-level features.
2020-03-07 12:12:01 -08:00
Dirkjan Ochtman 0a4bca7049 Remove old authentication data APIs 2020-03-07 12:12:01 -08:00
Dirkjan Ochtman 9a9be3887d Add AuthenticationData type to confer TLS crypto bits 2020-03-07 12:12:01 -08:00
Dirkjan Ochtman a7c9df18d6 Move crypto wrapper types back into quinn-proto
This is the second time we flip-flop on this. Previously in
4fd486862b (#351) we moved these types from
quinn into quinn-proto so that they could be used as part of the low-level
configuration API.

Then in 9522b44600 (#511) we moved them back
into quinn after some discussion, making the point that the configuration
API at the quinn-proto was not in a great place.

Here, we keep the existing quinn-proto configuration API and merely offer
an abstracted API relying on the wrapper types for use in quinn internals.
2020-03-07 12:12:01 -08:00
Benjamin Saunders f0108af5cd Fix Stream::finish hang on closed connections 2020-02-28 22:04:28 -08:00
Benjamin Saunders f92f2c7de5 Reexport TransportError(Code)
These are public in ConnectionError.
2020-02-28 22:04:28 -08:00
Benjamin Saunders 189945c673 Improve wording 2020-02-27 07:08:31 +01:00