Commit Graph

3653 Commits

Author SHA1 Message Date
Benjamin Saunders d38854b0a6 quinn: Return ReadError::Reset persistently
Improves symmetry with `WriteError::Stopped`. The proto layer can't
provide this behavior because it discards stream state, but we have
our own application-owned state and need to defer error reporting
sometimes anyway, so we might as well make this more intuitive.
2024-05-22 14:41:13 -07:00
Benjamin Saunders 94ba08261c Factor out common Retransmits::max_stream_id update logic 2024-05-22 14:00:59 -07:00
Benjamin Saunders d88e33b5ce Simpler and more precise ID flow control update check in Chunks
Bi-directional streams might not be freed immediately on reading to
end or receiving a reset, and `StreamsState::stream_freed` already
performs the exact accounting required for this case when we call it
on entering Finished or Reset state.
2024-05-22 14:00:59 -07:00
Benjamin Saunders 299425b324 impl From<StoppedError> for io::Error 2024-05-22 13:10:40 -07:00
Benjamin Saunders e0125c5750 Move impl after the most relevant type 2024-05-22 13:10:40 -07:00
Benjamin Saunders 91dd2408da Factor out criterion for sending stream-level flow control 2024-05-22 13:09:25 -07:00
Benjamin Saunders 7dfd5e475b Rename receiving_unknown_size to final_offset_unknown for clarity 2024-05-22 13:09:25 -07:00
Benjamin Saunders be42c57553 Don't send stream-level flow control updates for stopped streams
We only queue MAX_STREAM_DATA when stream data is read by the
application, which never happens for stopped streams, but loss of
packets carrying previously sent MAX_STREAM_DATA frames could still
cause fresh ones to be queued unnecessarily. Filtering them out isn't
strictly necessary, but saves some space in the packet.
2024-05-22 13:09:25 -07:00
Benjamin Saunders 62b4f3fec9 Fix stopped recv stream flow control underflow under reordering
If frames are received out of order (e.g. due to packet loss) on a
stopped stream, the local `end` might be less than the high water mark
`Recv::end`. The previous code would set `Assembler::bytes_read` to
that incorrect lower value, potentially after it had previously taken
a higher value.

If `MAX_STREAM_DATA` frames are then queued for that stream (e.g. due
to retransmits prompted by packet loss), we might attempt to transmit
a smaller flow control credit than we had previously. This would cause
an underflow in the subtraction used to judge whether an increase in
flow control credit is worth sending, and violates the spec besides.

Because additional data on a stopped stream isn't useful, there's no
benefit to updating stream-level flow control at all, so we might as
well remove that path entirely. Connection-level flow control is still
maintained at the StreamsState level based on change in the stream's
high-water mark or determination of the final offset.
2024-05-22 13:09:25 -07:00
Dirkjan Ochtman 540296c268 Bump version numbers 2024-05-21 21:48:27 +02:00
Dirkjan Ochtman 4bc79dce72 Deduplicate ClosedStream types 2024-05-21 21:48:27 +02:00
Dirkjan Ochtman f82beab2f3 proto: make NoInitialCipherSuite Clone 2024-05-21 21:48:27 +02:00
Floris Bruynooghe 170a9cda1d Support openbsd
OpenBSD supports ECN on IPv6 but not on IPv4 it seems.  This splits
off the test cases so that IPv6 ECN support is tested in isolation.
2024-05-21 11:31:02 -07:00
Benjamin Saunders f952714dfe quinn: Fix bytes read count in ReadExactError::FinishedEarly
This was counting the number of bytes read in the current `poll`
invocation, rather than the lifetime of the future.
2024-05-20 23:10:08 +02:00
Benjamin Saunders 1b913cb20b Relax unnecessary unique borrow 2024-05-19 11:35:37 -07:00
Benjamin Saunders e37a8f2e06 Centralize and update local_ip platform support documentation 2024-05-18 11:32:00 -07:00
Benjamin Saunders 9c2c553d95 Reduce black hole detection false positives
Exactly MTU-sized datagrams aren't necessarily transmitted often, if
ever. As a result, black hole detection could previously reset the MTU
regularly at any nonzero packet loss rate.
2024-05-17 15:54:40 -07:00
Benjamin Saunders cccf35bb89 Restrict tail loss probes to guaranteed minimum MTU 2024-05-17 15:54:40 -07:00
Benjamin Saunders 1bb5e8e040 Rename packet description arguments for better concision/uniformity 2024-05-17 15:54:40 -07:00
Benjamin Saunders a82e7310e8 Abstract out unit test access to black hole detection state 2024-05-17 15:54:40 -07:00
Benjamin Saunders 68e7a1d12f Remove redundant field
In `last_burst_was_suspicious`, if the last burst contains
non-suspicious packets, we bail out early. If it doesn't,
`largest_suspicious_packet_lost` is necessarily equal to
`largest_non_probe_lost`. No other code reads this field, so it is
redundant to `largest_non_probe_lost`.
2024-05-17 15:54:40 -07:00
Benjamin Saunders 47d54f02ae Pass entire TransportConfig to PathData::new for concision 2024-05-17 15:54:40 -07:00
Benjamin Saunders 2d164dbb4d Fix MTU detection being enabled erroneously after migration 2024-05-17 15:54:40 -07:00
Dirkjan Ochtman 8bd0600089 proto: support creating config wrappers from Arc-wrapped configs 2024-05-14 18:53:52 +02:00
Dirkjan Ochtman 690736cb2f proto: add rustls constructors with explicit initial 2024-05-14 18:53:52 +02:00
Benjamin Saunders 393b617ef1 Use previous path CID for previous path validation 2024-05-12 20:45:07 -07:00
Benjamin Saunders e0a15513fc Store active CID with previous path 2024-05-12 20:45:07 -07:00
Benjamin Saunders 664d341007 Pass destination CID explicitly to PacketBuilder
Groundwork for breaking linkability when transmitting off-path.
2024-05-12 20:45:07 -07:00
Benjamin Saunders aeb520cf36 Remove redundant version argument 2024-05-12 20:45:07 -07:00
Benjamin Saunders d613895194 Invert condition to reduce rightward drift 2024-05-12 11:13:39 +02:00
Benjamin Saunders 4416e03d93 Remove newly redundant branch 2024-05-12 11:13:39 +02:00
Benjamin Saunders 7db395b1e7 Fold 0-RTT send readiness check into initial branch 2024-05-12 11:13:39 +02:00
Benjamin Saunders 04c049d52c Fold can_send_1rtt check into initial branch 2024-05-12 11:13:39 +02:00
Benjamin Saunders b2784e970a Remove redundant branch
When this check fails, indicating that `can_send ==
SendableFrames::empty()`, we return `SendableFrames::empty()` anyway.
2024-05-12 11:13:39 +02:00
Benjamin Saunders 1d73078d79 Test voluntary acks when sending max-size datagrams 2024-05-09 13:51:09 +02:00
Benjamin Saunders a35ad73f97 Bump version 0.11.1 2024-05-08 23:21:39 +02:00
Benjamin Saunders 50708cf120 Test interaction between large datagram frames and ACKs 2024-05-08 23:21:39 +02:00
Benjamin Saunders 55be92985a Fix empty packets when segment size is too small for queued data
The prior logic could even produce panics if segment size falls below
MIN_PACKET_SPACE.
2024-05-08 23:21:39 +02:00
Benjamin Saunders d52e7f6cb0 Suppress ACK-only packet sanity-check when datagrams are queued 2024-05-08 23:21:39 +02:00
Benjamin Saunders f0dff01d4f Fail GSO truncation test if packets are lost 2024-05-08 20:24:49 +02:00
叶落寒塘 23f9f45228 Fix corruption of trailing packet in truncated GSO batch 2024-05-08 20:24:49 +02:00
Dirkjan Ochtman 1e547588e8 quinn: alphabetize default features 2024-05-07 11:21:24 +02:00
Benjamin Saunders 359c0c7dae Add ring to default features
Required for `Endpoint::{client, server}` and various other helpers
intended to simplify getting started.
2024-05-07 11:21:24 +02:00
Benjamin Saunders 0e9a19665a Rename UnknownStream to ClosedStream for clarity 0.11.0 2024-05-03 11:52:44 -07:00
Benjamin Saunders 130d956efc Don't treat UnknownStream as an error in SendStream::stopped
UnknownStream here corresponds to graceful stream shutdown, which is
not an error case.
2024-05-03 11:52:44 -07:00
Benjamin Saunders b42e21e74d Make SendStream::finish synchronous
`await`ing on this was error-prone and not very useful, since it gave
little insight into application state, and was redundant to `stopped`.
2024-05-03 11:52:44 -07:00
Dirkjan Ochtman f28cb3d8d6 Check compilation without default features in CI
Other workspace members enable some features, so check in isolation.
2024-05-03 11:38:05 -07:00
Dirkjan Ochtman 272dd5d45f quinn: add proper guards to Endpoint constructor helpers 2024-05-03 11:38:05 -07:00
Dirkjan Ochtman 74c035822b quinn: UdpPoller::new() is only called if a runtime is enabled 2024-05-03 11:38:05 -07:00
Dirkjan Ochtman faf7dbc051 quinn: require rustls for insecure_connection example 2024-05-03 11:38:05 -07:00