1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-09 10:00:57 +03:00
Commit Graph

30 Commits

Author SHA1 Message Date
Matt Joras
472e40a902 Implement handshake done and cipher dropping.
Summary: This implements the handshake done signal and also cipher dropping.

Reviewed By: yangchi

Differential Revision: D19584922

fbshipit-source-id: a98bec8f1076393b051ff65a2d8aae7d572b42f5
2020-02-27 12:25:52 -08:00
TJ Yin
a396f62335 Replace folly::Optional::hasValue() by has_value()
Differential Revision: D19882830

fbshipit-source-id: 031217f9890351022bc8d171f0ccd7e045dd6972
2020-02-26 08:40:44 -08:00
Udip Pant
21a7efb2e3 remove constraints of 4-bytes minimum len for connection-id
Summary:
New QUIC draft no longer has this limitation for connection-id, and allows
connid of len 0 -> 20.

This diff removes the constraints. I still kept the requirement for
*server-chosen* conn-id

Reviewed By: mjoras, lnicco

Differential Revision: D19507366

fbshipit-source-id: 4c73f45617f40b29d47d2d86b7598f6c95588d0a
2020-01-23 21:59:49 -08:00
Anton Frolov
1482011db5 Remove UNLIKELY and LIKELY calls from mvfst
Summary:
All instancesi of LIKELY and UNLIKELY probably should be removed. We will
add them back in if we see pathologies in performance profiles.

Reviewed By: mjoras

Differential Revision: D19163441

fbshipit-source-id: c4c2494d18ecfd28f00af1e68ecaf1e85c1a2e10
2020-01-06 17:44:07 -08:00
Matt Joras
9dae0abe05 Fix appliication close writing/parsing
Summary: There's no triggering frame type for application closes.

Reviewed By: yangchi, raghunallamothu

Differential Revision: D19191873

fbshipit-source-id: 66cc2098e1f7671fabab0a2309deaabe7922a18e
2019-12-20 18:58:54 -08:00
Matt Joras
f8e162931b Use folly::small_vector in a few places
Summary: By using something which inlines some number of elements, we can avoid doing any mallocs from `std::vector` in the common cases. This also eliminates one layer of indirection in the common case.

Reviewed By: siyengar

Differential Revision: D18903523

fbshipit-source-id: 9f72e93f58a6b42777e5afe10e7ee6a13bf94c66
2019-12-12 12:06:30 -08:00
Subodh Iyengar
b7185a418b add missing check in decodepaddingframe
Summary: Add missing 0 bytes check in decodePaddingFrame

Reviewed By: mjoras

Differential Revision: D18921498

fbshipit-source-id: d02baf37cad090251c67e56140adfc734ecee5ef
2019-12-10 18:45:32 -08:00
Subodh Iyengar
7614e8e52e collapse most sequential padding frames
Summary:
For padding frames we don't really need to know the exact number of padding frames in the packet,
but just that a padding frame exists.

This diff tries to collapse multiple sequential padding frames into 1 frame while decoding the packet.
While this wont collapse all padding frames, the common case is that padding is sequential and at the
end of the packet.

Reviewed By: JunqiWang

Differential Revision: D18901925

fbshipit-source-id: 17b4eeabdbf4df01c900a9d5078891eb64bf254a
2019-12-09 21:02:23 -08:00
Subodh Iyengar
e524c0c069 iobufqueue diediedie
Summary:
Don't use IOBufQueue for most operations in mvfst and use BufQueue instead. Since BufQueue did not support a splitAtMost, added it in instead.

The only place that we still use IOBufQueue is in crypto because fizz still requires it

Reviewed By: mjoras

Differential Revision: D18846960

fbshipit-source-id: 4320b7f8614f8d2c75f6de0e6b786d33650e9656
2019-12-06 12:06:44 -08:00
Subodh Iyengar
17ee9aade0 dont clone during decode
Summary:
Don't clone during decoding a stream frame.

This uses a BufQueue to manage the data instead of passing around cursors.

Reviewed By: yangchi

Differential Revision: D18827718

fbshipit-source-id: 7874d308bb5f43b983b9965b2862e733a2107039
2019-12-05 14:15:11 -08:00
Raghu Nallamothu
e06de27550 Merge Application Close Frame and Connection Close Frame
Summary: As a part of Draft 17, application close frame has been removed, we use connection close frame to represent both application close and connection close.

Reviewed By: mjoras

Differential Revision: D18580856

fbshipit-source-id: d274fa2d3dbc59b926bca5a2b8a20328ae582703
2019-12-03 15:02:06 -08:00
Raghu Nallamothu
e06c0848e0 T24905463 - [quic][ping] Implement ping in Quic
Summary: Implement ping functionality in ping

Reviewed By: yangchi

Differential Revision: D17885286

fbshipit-source-id: 4c328d14a023057d6889818250c0129c06e60874
2019-10-21 17:07:12 -07:00
James Donald
33a4320b23 Fix MSVC unused variable warnings
Summary: These otherwise show up as `warning C4101: 'e': unreferenced local variable`

Reviewed By: udippant

Differential Revision: D17855614

fbshipit-source-id: 3c1f65c6c46827d2567da27e1145ce73184659d8
2019-10-11 11:27:15 -07:00
Viktor Chynarov
fa98978d6d Back out "Revert D15264935: [quic] Make RetireConnectionIdFrame a QuicSimpleFrame (for now)"
Summary: Original commit changeset: aa2ccf4bb39e

Reviewed By: lnicco

Differential Revision: D17688496

fbshipit-source-id: e627784cdfe208994cbae3f71062d74d312d3600
2019-10-01 11:11:05 -07:00
Shawn Shihang Wei
5cf3c6ce67 Revert D15264935: [quic] Make RetireConnectionIdFrame a QuicSimpleFrame (for now)
Differential Revision:
D15264935

Original commit changeset: 8c66c4604e24

fbshipit-source-id: aa2ccf4bb39ec3b0286baaed5cc42bf9065f4fcd
2019-09-30 18:49:59 -07:00
Viktor Chynarov
0ab06b6fc9 Make RetireConnectionIdFrame a QuicSimpleFrame (for now)
Reviewed By: sharma95

Differential Revision: D15264935

fbshipit-source-id: 8c66c4604e24442f4c77e8eb2d10901d1702adc7
2019-09-30 17:40:13 -07:00
Viktor Chynarov
7c578e2d98 zero-length client connection id support
Summary:
Allow the client to set zero-length id for itself.
If enabled, saves 8 bytes (if packet isn't padded to minimum).
However, will be disabled if connection migration is enabled.

Main changes include updating the short header parsing to pass
in the connection id length, since unlike long headers,
short header's dst conn id isn't preceeded by length.

Created a new `QuicClientTransportAfterStartTestBase` class
to move `testing::WithParamInterface<>` inheritance to subclasses.
(Only one parameter per test class).

Reviewed By: JunqiWang

Differential Revision: D17188777

fbshipit-source-id: f60a7f3c07da1a8c83cec5b518075d23daedbe44
2019-09-23 15:01:43 -07:00
Subodh Iyengar
04baa15a04 Custom variant type for packetheader
Summary:
Make a custom variant type for PacketHeader. By not relying on boost::variant
this reduces the code size of the implementation.

This uses a combination of a union type as well as a enum type to emulate a variant

Reviewed By: yangchi

Differential Revision: D17187589

fbshipit-source-id: 00c2b9b8dd3f3e73af766d84888b13b9d867165a
2019-09-19 17:31:47 -07:00
Matt Joras
15fbe5106c Explicit stream frame types
Summary:
Prior to this we had an incorrect check for something being a stream frame. It technically should have worked for minimally encoded frame types, but would not work for a spec-incompliant frame type.

Instead of using a mask this makes it so each stream frame type is explicitly enumerated. This isn't as clean looking but is easier to validate as correct.

This also revealed some places where we were not correctly plumbing through the version for unit tests, so fixing those as a driveby.

Reviewed By: yangchi

Differential Revision: D16676631

fbshipit-source-id: 835dcc6e1f431bbe3fa4a5c6b8e616863c126155
2019-08-08 09:02:03 -07:00
László Várady
63190ee77b quic/codec: fix unsigned-signed comparison errors (#36)
Summary:
Compiling mvfst on Arch Linux (GCC 9.1.0) results in `sign-compare` warnings/errors.

```
Decode.cpp:125:28: error: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘long int’ [-Werror=sign-compare]
  125 |           adjustedAckDelay >
      |           ~~~~~~~~~~~~~~~~~^
  126 |           std::numeric_limits<std::chrono::microseconds::rep>::max())) {
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PacketNumberCipher.cpp:122:14: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::array<unsigned char, 16>::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
  122 |       outLen != outMask.size()) {
      |       ~~~~~~~^~~~~~~~~~~~~~~~~
```

Both `outLen` (`EVP_EncryptUpdate() == 1`) and `std::chrono::microseconds::rep>::max` are guaranteed to be non-negative, so I've used `static_cast<unsigned>()` on them.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/36

Reviewed By: mjoras

Differential Revision: D16675626

Pulled By: yangchi

fbshipit-source-id: 8261a6c1f100a2f55516a9a2fb7f18c40a5794cc
2019-08-07 13:38:58 -07:00
Junqi Wang
346a51f63f Update NewConnectionIdFrame to D-22
Summary: ^

Reviewed By: sharma95

Differential Revision: D16466184

fbshipit-source-id: f5a9b8e65e92048393b78305b0d176ab2f4fe338
2019-07-25 11:52:20 -07:00
Matt Joras
a18bd486d0 Fix stateless retry parsing for draft-22
Summary: This was affected by CID length fields as well.

Reviewed By: sharma95

Differential Revision: D16402854

fbshipit-source-id: 09421f42fd0c9629d852a0e9c24f966babab8aae
2019-07-23 14:38:22 -07:00
Matt Joras
ece3cbe387 Draft-22 varint error codes
Summary: These were changed to varints. To support this we need to do some extra horrible version plumbing. I don't want to keep this long term but it works for now.

Reviewed By: yangchi

Differential Revision: D16293568

fbshipit-source-id: a9ea9083be160aa3e6b338a7d70d7f00e44ec5ab
2019-07-18 12:07:57 -07:00
Matt Joras
2f528e68c0 Draft-22 invariants change
Summary:
Draft-22 onwards uses two one byte length fields to encode connection ID length instead of one one byte length field.

To support this without disrupting existing clients we need to make our parsing version dependent. This diff accomplishes it by special casing the existing Facebook client QUIC version (0xfaceb000), and changing the default Facebook client version going forward to 0xfaceb001.

Note that this diff also changes the behavior of the ticket transport parameters. When we changed from draft-18 to draft-19 transport parameters I apparently forgot to update the ticket transport parameters to the new format.

Reviewed By: yangchi

Differential Revision: D16205090

fbshipit-source-id: e74a92fa959d308f4bb43bad76e58d4b58d07322
2019-07-16 17:59:58 -07:00
Udip Pant
4026882c9d Remove unused isUnidirectionalStream() function
Reviewed By: JunqiWang

Differential Revision: D15538072

fbshipit-source-id: 49b26a708431c6409ec495f53ea7304ebdec5fde
2019-05-29 10:25:25 -07:00
Kyungmin (Jason) Lee
34e307a8de Remove unused isBidirectionalStream() function to unblock auto-syncer
Summary: Removing unused isBidirectionalStream() function.

Reviewed By: yangchi

Differential Revision: D15536344

fbshipit-source-id: 36ff69df5d13d12ad95aa1c70ece4eba84d2e7f4
2019-05-29 08:14:52 -07:00
Udip Pant
b64e4f99ef Interpret varint in MAX_STREAMS_FRAME as count and not as stream-id
Summary: post draft-17 it is interpreted as count not the max stream id

Reviewed By: mjoras

Differential Revision: D15523021

fbshipit-source-id: 779a1c5269eb8dbcdcd169303caa7a65e467339c
2019-05-28 14:48:56 -07:00
Udip Pant
4a9537798e Add correct license headers on some missing files
Summary: ^

Reviewed By: sharma95

Differential Revision: D15172546

fbshipit-source-id: bacc832752a433b86962e77bb19aff4504640e60
2019-05-01 22:42:04 -07:00
udippant
79032c7b9b fbshipit-source-id: f498ac5e677b2931d937ba78edd4373ba04dca2a 2019-04-25 21:33:43 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00