Commit Graph

2307 Commits

Author SHA1 Message Date
Benjamin Saunders de4323ed24 Proactively deduplicate stream data when using unordered reads
Ensures we don't yield the same data to the application repeatedly,
and only issue flow control credit in response to new data.
2020-05-29 16:04:52 +02:00
Benjamin Saunders bdedc0ab2e Remove unused fine-grained received range tracking 2020-05-29 16:04:52 +02:00
Benjamin Saunders a604266fa7 Remove redundant receive stream state
DataRecvd was used to identify when all data has been received but not
yet read by the application, but we can determine that on-demand in
the Recvd state.
2020-05-29 16:04:52 +02:00
Benjamin Saunders dbe26a7ba1 Fix incorrect initial offset in Assembler::defragment
When there's a leading gap in the buffered data or unordered reads are
in use, `self.offset` does not represent the starting point of the
first chunk.
2020-05-29 16:04:52 +02:00
Benjamin Saunders cdb3074402 Fix miscounting of unordered bytes read 2020-05-29 16:04:52 +02:00
Jean-Christophe BEGUE cbbd76ec60 H3: poll for STOP_SENDING 2020-05-29 15:22:26 +02:00
Jean-Christophe BEGUE 58a3c057c4 Stopped event for SendStream 2020-05-29 15:22:26 +02:00
Benjamin Saunders 29b3bba38f More generous default receive buffer size 2020-05-29 07:37:28 +02:00
Dirkjan Ochtman 01bb2f1162 Clarify documentation on setting up mTLS (fixes #772) 2020-05-27 18:53:52 -07:00
Benjamin Saunders ed6a8ac778 Fold reset/retry tokens into the same module 2020-05-25 06:22:35 +02:00
Benjamin Saunders a0b7e19aeb Apply our usual contractions to transport parameter names 2020-05-25 06:22:35 +02:00
Benjamin Saunders 17dae925f0 Clarify token payload 2020-05-25 06:22:35 +02:00
Benjamin Saunders bd217aecf1 Shorter retry token
A well-behaved client sends retried Initial packets to the source
CID provided in the Retry packet, i.e. the retry_src_cid. Just like
the source address, this means that it's present in the incoming
packet already so we don't need to encode it explicitly in the retry
token, just authenticate it.
2020-05-25 06:22:35 +02:00
Benjamin Saunders 14920a516b Remove unnecessary unwrap 2020-05-25 06:22:35 +02:00
Benjamin Saunders d0d6afbffe Refactor transport parameter CID encode/decode 2020-05-25 06:22:35 +02:00
Benjamin Saunders f2178ff91c Factor out common connection ID encode/decode logic 2020-05-25 06:22:35 +02:00
Benjamin Saunders 47dad2292e Bundle retry token payload into a struct 2020-05-25 06:22:35 +02:00
Benjamin Saunders ca689d33d6 Update version numbers for draft 28 2020-05-25 06:22:35 +02:00
Benjamin Saunders 075fbb2ab9 Don't reset PTO backoff when our address need not be validated 2020-05-25 06:22:35 +02:00
Benjamin Saunders 8c81bb7c6e Remove dead state 2020-05-25 06:22:35 +02:00
Benjamin Saunders 7f7717ba46 Correct errors on illegal stream limits 2020-05-25 06:22:35 +02:00
Benjamin Saunders 5329a047ab Discard spurious version negotiation packets 2020-05-25 06:22:35 +02:00
Benjamin Saunders f9ef94f155 Discard Retry packets after successfully decrypting anything else 2020-05-25 06:22:35 +02:00
Benjamin Saunders b5021d46dd Don't leak application close details during handshake 2020-05-25 06:22:35 +02:00
Benjamin Saunders f5d4ab5624 Capture connection ID from preferred address TP
Previously, that slot in the active connection ID limit would be
leaked.
2020-05-25 06:22:35 +02:00
Benjamin Saunders 1d7a32f70f Simplify sending of initial close packets 2020-05-25 06:22:35 +02:00
Benjamin Saunders 085236b2f4 Fix inverted 0-RTT transport parameter validation 2020-05-25 06:22:35 +02:00
Benjamin Saunders e15b2be713 Rename Connection.params to peer_params for clarity 2020-05-25 06:22:35 +02:00
Benjamin Saunders b4ae98b0b3 Move retry token logic into a dedicated module 2020-05-25 06:22:35 +02:00
Benjamin Saunders 0422deada1 Draft 28 transport parameters 2020-05-25 06:22:35 +02:00
Benjamin Saunders 9085f457e8 Update rustls for interop fixes 2020-05-24 11:03:11 -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
Dirkjan Ochtman de5dc88782 Move DecodeHeaders into data module 2020-05-22 15:21:36 +02:00
Dirkjan Ochtman 7117e01929 Move WriteFrame into data module 2020-05-22 15:21:36 +02:00
Dirkjan Ochtman aa1ebbab76 H3: simplify ownership of SendStream (fixes #768) 2020-05-22 15:21:36 +02:00
Jean-Christophe BEGUE 68b866bc63 H3: Ignore unknown incoming uni stream 2020-05-21 10:42:26 +02:00
Jean-Christophe BEGUE 5f5be440dc H3: ignore unknown frames 2020-05-21 10:42:26 +02:00
Jean-Christophe BEGUE 061733dc1e H3: send get requests with FakeRequest helpers 2020-05-21 10:42:26 +02:00
Jean-Christophe BEGUE 77aeb5544b H3: enable tracing by default in tests 2020-05-21 10:42:26 +02:00
Benjamin Saunders 7a05701e05 Simplify stream stop logic 2020-05-21 09:28:42 +02:00
Benjamin Saunders d4b7a8f73e Additional stream testing 2020-05-21 09:28:42 +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 959227566e Reject connections on ALPN failure 2020-05-21 09:22:59 +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 a58b712e46 Don't double-count acknowledgement of reset stream data 2020-05-20 12:52:34 +02:00
Benjamin Saunders 0e24d2224e Ignore redundant reset frames
This could cause excess connection-level flow control credit to be
issued.
2020-05-20 12:52:34 +02:00
Benjamin Saunders 9cf8652deb Fix empty stream frames not raising stream watermark 2020-05-20 12:52:34 +02:00
Benjamin Saunders 36a040bcf9 Ignore redundant stream reset calls
Prevents corruption of internal state on API misuse.
2020-05-20 12:52:34 +02:00
Benjamin Saunders 6e9f7e8063 Clarify variable name 2020-05-13 06:46:44 +02:00