2755 Commits

Author SHA1 Message Date
Dirkjan Ochtman a24e569ef4 Bump quinn-proto version number to 0.7.3 0.7.3 2021-05-03 13:31:06 -07:00
David Craven 7e848f0023 Allow overriding supported versions in EndpointConfig (#1106) 2021-05-03 21:42:17 +02:00
David Craven b304fc0f77 Allow upgrading keys before sending CRYPTO frames 2021-04-23 12:01:18 -07:00
Benjamin Saunders 9a938209de Bump versions 0.7.2 2021-04-04 23:32:40 +02:00
Benjamin Saunders 469206fd9e Remove clippy from CI
This is a stable branch, where the churn of adapting to new clippy
lints isn't justified.
2021-04-04 13:41:46 -07:00
Thomas de Zeeuw a78e643f26 Increase type_length_limit to 2121396
Previously rustc would fail with
error: reached the type-length limit while instantiating
`<std::vec::IntoIter<Peer> as std...rs:216:58: 220:6 keylog:&bool]]>`

(cherry picked from commit 817a57d281)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 858fc91846 Import assert_matches explicitly
Fixes test build on rust beta.

(cherry picked from commit a5667774f8)
2021-04-04 13:41:46 -07:00
Thomas de Zeeuw ac6b8947c8 Increase MSRV to 1.46
(cherry picked from commit 2a6c0afaf1)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 5478002dda Simplify state juggling
(cherry picked from commit 5bd1ba570b)
2021-04-04 13:41:46 -07:00
Benjamin Saunders cb684d41fd Don't unconditionally predict transmits on reset
The exact logic should handle this case just fine.

(cherry picked from commit 6616bc958a)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 4ca6b14017 Fix transmit prediction false negative regarding stream ID credit
(cherry picked from commit 7ba3e3d3d3)
2021-04-04 13:41:46 -07:00
Benjamin Saunders d3a3e655a8 Inline Retransmits::post_read
(cherry picked from commit e4c3d9f89f)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 7d75679f21 Centralize post_read calls
(cherry picked from commit 9d0d10ca6f)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 0517fb7ff6 Simplify state inspection
(cherry picked from commit 08996a3676)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 54419f6ef3 Decouple state from connection-level flow control issuing
(cherry picked from commit 4b2909ac1a)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 1f1143cfa4 Deduplicate asserts
(cherry picked from commit 3d3a0aa849)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 4dd270af35 Inline Chunks::done
(cherry picked from commit ed6ddd46bd)
2021-04-04 13:41:46 -07:00
Benjamin Saunders c64278271d Fold Blocked state into Readable
Because the only remaining possible error is Reset, we rename and
specialize the error state for clarity.

(cherry picked from commit 63b0586a2d)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 1a294e4f83 Improve test log readability
(cherry picked from commit 8538ff31c1)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 1544b3bd6c Fix missing flow control credit when reading a stream's tail
(cherry picked from commit e703d9d643)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 857bd78fb5 Remove dead state
This field was always `true`.

(cherry picked from commit 2cb44d06e4)
2021-04-04 13:41:46 -07:00
Benjamin Saunders 1056297a72 Bump versions 0.7.1 2021-03-20 19:52:20 +01:00
bstrie c30d8e687e Replace deprecated collections::Bound with ops::Bound
(cherry picked from commit ab61ef89f5)
2021-03-20 19:24:20 +01:00
Benjamin Saunders 2c1c50ae3d Pad ack-eliciting initial-bearing datagrams from servers
Quoth the spec: a server MUST expand the payload of all UDP datagrams
carrying ack-eliciting Initial packets to at least the smallest
allowed maximum datagram size of 1200 bytes.

(cherry picked from commit b7e95fdba7)
2021-03-11 19:18:40 +01:00
Benjamin Saunders 811a28e01f Remove obsolete safety asserts
These will cause spurious panics once
https://github.com/rust-lang/rust/pull/78802 is merged.

(cherry picked from commit 9287a34d63)
2021-03-11 19:18:40 +01:00
Benjamin Saunders d799cbed61 Fix stream leak on stop after finish 2021-03-11 09:53:12 -08:00
Benjamin Saunders 044d7f0c4a Don't issue flow control credit for streams with known size
A stream's size is only known after we've issued at least that much
flow control credit, so the peer necessarily won't need any more. Our
logic to schedule credit issuing already uses similar judgement, so
this brings the last-minute sanity check into alignment.
2021-03-11 09:53:12 -08:00
Matthias Einwag 5d4352a40d Wake up a stream only if stream window is not empty
This avoids a wakeup in case the connection window increased but the
stream window is still empty.
0.7.0
2021-03-02 10:08:06 +01:00
Matthias Einwag f16db0ba93 Wake up stream only if connection window is not empty
This avoids a wakeup in case the stream window increased but the
connection window is still empty.
2021-03-02 10:08:06 +01:00
Matthias Einwag 6c47d3a318 retry transmitting close frames
This changes makes sure we don't lose close frames when the first send attempt
is blocked by congestion control.
2021-03-02 09:16:01 +01:00
Matthias Einwag 312c0f041c Perf: Use owned buffers
Use zero-copy APIs when sending data in perf application.

Performance difference:
1. First line is before
2. Second line is after (but with only the download write change)

```
      │ Duration  │ FBL       | Upload Throughput | Download Throughput
──────┼───────────┼───────────┼───────────────────┼────────────────────
 AVG  │    5.00ms │    1.00ms │      332.82 MiB/s │        334.20 MiB/s
 AVG  │    5.00ms │    0.00ns │      332.64 MiB/s │        335.96 MiB/s
```

=> Makes less than 1%. Still neat to have
2021-03-02 09:13:00 +01:00
Benjamin Saunders bb6f76a7d9 Bump versions 2021-03-02 07:17:56 +01:00
Benjamin Saunders 61ee819d2a Remove version requirement for fuzzing
This subcrate isn't published, so it can use an unversioned path
dependency.
2021-03-02 07:17:56 +01:00
Matthias Einwag 3de2727b94 Perf: Prefer more efficient cipher suites
Prefer AES128 in order to maximize throughput
2021-03-02 07:01:16 +01:00
Matthias Einwag 82a065ac3e Make perf up and download more efficient
Pass a bigger buffer to write calls to minimize the amount of write calls.
2021-03-02 07:01:16 +01:00
Matthias Einwag 7700046af6 Aggregate perf stats and print them 2021-03-02 07:01:16 +01:00
Matthias Einwag 3bbb15181f Capture per request timings in perf client 2021-03-02 07:01:16 +01:00
Matthias Einwag f811d3635c Allow to specify the perf client to run for a certain amount of time 2021-03-02 07:01:16 +01:00
Matthias Einwag e8af8fd507 Make handling of uni and bidi streams equal
Uni response streams are now accepted as part of the
request lifecycle, which makes it easier to gather stats.
2021-03-02 07:01:16 +01:00
Matthias Einwag 12039602ae perf: use tokio::try_join instead of select
We want all subtasks to complete, and not only a single one.
2021-03-02 07:01:16 +01:00
Matthias Einwag 270016a1da Use owned buffer API for sending data in the bulk test
This avoids the allocation inside the the connection Mutex.
2021-03-02 06:49:34 +01:00
Matthias Einwag 31109bd16f Make owned bytes write APIs available in quinn
This extends the public quinn API to offer support for writing owned buffers.
Besides the universal `write_chunks` API which supports a variable amount
of buffers the API also offers convenience methods for writing either a
single buffer completely or an arbitrary amount of buffers completely.
2021-03-02 06:49:34 +01:00
Matthias Einwag 5ce48e1897 Account for offset=0 requiring no space
When a frame contained data for an offset of 0, the transmit logic did not
fully fill a packet. The reason for this is that the logic reserved 1 byte for
writing an offset. However storing offset 0 doesn't require 1 byte,
because it will be encoded with a special flag in the message header.

Without GSO, this isn't a huge issue. It mostly means we are wasting
1 byte per datagram.

However with GSO, this actually leads to data corruption:

When using GSO, and  packet isn't fully filled, it later gets padded
to MTU size. Padding a packet ending with a STREAM frame that
doesn't contain a length information is however invalid, and will let
the receiver assume the padding is part of part of the data. This means
the receiver will receive an extra `0` at the end of a stream - and
depending on the duplicate detection at the receiver either the 0
or the correct byte in the next packet will win.
2021-03-01 22:14:43 +01:00
Dirkjan Ochtman 62924202fa quinn-proto: reorder code from bytes_source module 2021-03-01 13:06:10 -08:00
Dirkjan Ochtman 4abf5a64e0 quinn-proto: merge bytes_source module into connection::streams::send 2021-03-01 13:06:10 -08:00
Dirkjan Ochtman 971265d9ff quinn-proto: provide datagrams API access through special-purpose type 2021-03-01 13:06:10 -08:00
Dirkjan Ochtman 61129c811e quinn-proto: move datagram write logic into DatagramState 2021-03-01 13:06:10 -08:00
Dirkjan Ochtman 2637dfe575 quinn-proto: move incoming datagram frame handling into DatagramState 2021-03-01 13:06:10 -08:00
Dirkjan Ochtman d25ce15239 quinn-proto: move datagram receive logic into DatagramState 2021-03-01 13:06:10 -08:00
Dirkjan Ochtman c6843a7c84 quinn-proto: derive Default for DatagramState 2021-03-01 13:06:10 -08:00