1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-24 04:01:07 +03:00
Commit Graph

26 Commits

Author SHA1 Message Date
Aman Sharma
987475eb44 Make a ChainedByteRange (build fixes included)
Reviewed By: mjoras

Differential Revision: D59473502

fbshipit-source-id: 30bb72fb5e07d12d9574a39fbeb9b8d3e76b36e6
2024-07-09 10:52:57 -07:00
Omer Strulovich
5f232b66a8 Revert D59359175: Make a ChainedByteRange abstraction [take 2]
Differential Revision:
D59359175

Original commit changeset: c132c0bb0f00

Original Phabricator Diff: D59359175

fbshipit-source-id: efc7229dd6de4aeecd61a067da60c94954b964ab
2024-07-06 07:51:30 -07:00
Aman Sharma
b725e0c8b6 Make a ChainedByteRange abstraction [take 2]
Reviewed By: jbeshay

Differential Revision: D59359175

fbshipit-source-id: c132c0bb0f0043a7337d7db21b2e85d4feef3f28
2024-07-06 00:00:45 -07:00
Chang Hua
709d457976 Revert D57080101: Make a ChainedByteRange abstraction
Differential Revision:
D57080101

Original commit changeset: 6334f7e1dfc1

Original Phabricator Diff: D57080101

fbshipit-source-id: c4c01c107817399e668de186de6ee4c0283552c3
2024-07-03 16:02:17 -07:00
Aman Sharma
eafe595f89 Make a ChainedByteRange abstraction
Summary: See title

Reviewed By: hanidamlaj

Differential Revision: D57080101

fbshipit-source-id: 6334f7e1dfc1fc2ea7867265bc8d0f8ee6343d3b
2024-07-03 15:19:43 -07:00
Giuseppe Ottaviano
cd4268b8f8 IOBuf moveToFbString().toStdString() -> to<std::string>()
Summary: Constructing an `fbstring` from an `IOBuf` and then converting that to `std::string` is inefficient: if the `IOBuf` is chained, that can end up copying the data twice. `to<std::string>()` does exactly one copy.

Reviewed By: mjoras

Differential Revision: D58379802

fbshipit-source-id: a1094dd63ae00fc123e0d695a800a017004562e9
2024-06-12 12:03:12 -07:00
Hani Damlaj
9340e3bf97 BufQueue::trimAtMost
Summary: - refactor BufQueue::trimAtMost for simplicity

Reviewed By: mjoras

Differential Revision: D47078455

fbshipit-source-id: 51ced8ccb1cdf42515e98a5da9d942ebef205ad0
2023-08-21 15:11:14 -07:00
Christian Clauss
b8396fc119 Fix typos discovered by codespell
Summary:
`codespell --ignore-words-list=arithmetics,atleast,crate,crated,deriver,ect,hel,onl,startin,whats --skip="*.lock"`
* https://pypi.org/project/codespell

X-link: https://github.com/facebookincubator/mvfst/pull/307

Reviewed By: hanidamlaj, lnicco

Differential Revision: D47809078

Pulled By: kvtsoy

fbshipit-source-id: 566557f2389746db541ff265a5dec8d6404b3701
2023-07-26 17:10:41 -07:00
Konstantin Tsoy
73edee8252 Back out "Fix typos discovered by codespell"
Summary:
Original commit changeset: 337824bc37bc

Original Phabricator Diff: D47722462

Reviewed By: jbeshay, terrelln, lnicco

Differential Revision: D47801753

fbshipit-source-id: 795ffcccbc2223608e2a707ec2e5bcc7dd974eb3
2023-07-26 12:49:13 -07:00
Facebook Community Bot
9d89b66485 Re-sync with internal repository 2023-07-25 09:45:22 -07:00
Hani Damlaj
711f0e30fc Back out "BufQueue::trimAtMost"
Summary:
Original commit changeset: 0ace20d07d8b

Original Phabricator Diff: D46776767

Reviewed By: lnicco

Differential Revision: D47007928

fbshipit-source-id: 6c8760683692d1b50168f8f5d82d79c98ebe7c31
2023-06-25 16:44:20 -07:00
Hani Damlaj
aff02e01ee BufQueue::trimAtMost
Summary:
- trimAtMost() can be implemented via splitAtMost()

- trimAtMost() now releases owned IOBuf if the entire chain is consumed

Reviewed By: mjoras

Differential Revision: D46776767

fbshipit-source-id: 0ace20d07d8b9adc1a5171e39732b8278776c332
2023-06-21 10:07:07 -07:00
Hani Damlaj
3787e35f24 BufQueue::splitAtMost
Summary: refactor splitAtMost(), add some comments

Reviewed By: mjoras

Differential Revision: D46776769

fbshipit-source-id: 4dd633f32add4133212c83e67ef42f414b68e499
2023-06-21 10:07:07 -07:00
Jianfeng Tang
0e39de88f3 Add unit test for BufQueue::clone
Summary: As titled.

Reviewed By: afrind

Differential Revision: D42036127

fbshipit-source-id: ae7fa598bd233e14261011be62de7e25f7d16ca2
2022-12-14 09:40:49 -08:00
Hani Damlaj
00e67c1bf9 mvfst License Header Update
Reviewed By: lnicco

Differential Revision: D33587012

fbshipit-source-id: 972eb440f0156c9c04aa6e8787561b18295c1a97
2022-01-18 13:56:12 -08:00
Hani Damlaj
2660a288b3 Update Company Name
Summary: - as title

Reviewed By: lnicco

Differential Revision: D33513410

fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
2022-01-13 12:07:48 -08:00
Giuseppe Ottaviano
df6ba03889 Add IOBuf convenience methods to convert to std::string
Summary:
Getting an `std::string` out of the data in a `IOBuf` chain is a common operation in tests, logging, and at interface boundaries. Currently there isn't an easy way to do it, so either the same boilerplate is replicated everywhere, or people resort to `coalesce().str()`, which is inefficient (it can end up copying the data twice) and non-`const`.

Add methods to append and convert to any char container, like `string`, `fbstring`, `vector<char>`, ...

Reviewed By: philippv

Differential Revision: D31385345

fbshipit-source-id: 8a331771786f7bf1043b59d5c36ac4051e442531
2021-10-06 00:14:15 -07:00
Yang Chi
09754aa4d6 Replace DEBUG check with NDEBUG check in Quic BufUtil death test
Summary: as title. Also move PushLimit to this section as well

Reviewed By: avasylev

Differential Revision: D22069760

fbshipit-source-id: 7d87e4fa142f0713c1b4a9c33b2f947fe8c740b5
2020-06-16 10:48:38 -07:00
Yang Chi
f7dfc9acd2 Quic test fix: put writeLimit test behind DEBUG flag
Summary:
The CHECK has been changed to DCHECK, so the EXPECT_DEATH now only
passes in DEBUG build

Reviewed By: lnicco

Differential Revision: D22067513

fbshipit-source-id: 1a0fa4c3efe1f41c4468d50fe975aed354214d64
2020-06-16 08:18:39 -07:00
Yang Chi
7b1672e164 Add a test case for Quic BufWriter
Summary:
forgot about this coverage in the original diff introduced the
BufWriter

Reviewed By: mjoras

Differential Revision: D20919832

fbshipit-source-id: 84d960a386d6a0ee91ea84366d369645463d10ad
2020-04-10 09:16:15 -07:00
Yang Chi
db58ba1ca4 Move Quic Stream data writing from WriteCodec to PacketBuilder
Summary:
Different Builders now want to have its own way of writing or
appending write buffer. So let builders handle them.

This also add new APIs in BufWriter to copy data from IOBuf/BufQueue directly
into a destination IOBuf without cloning inbetween.

Reviewed By: mjoras

Differential Revision: D20821789

fbshipit-source-id: c0a24eb12378f64cf26c27d4232f610ed80fba84
2020-04-07 08:46:14 -07:00
Yang Chi
44d9adbf0a Quic BufWriter
Summary:
Current Quic BufAppender and folly Cursor have the ability to append
other IOBufs into the targeting IOBuf, which isn't desired in our use case.
This BufWriter only writes, never appends. It copies the data into targeting
IOBuf if a private IOBuf is passed in.

Reviewed By: mjoras

Differential Revision: D20781978

fbshipit-source-id: 4749dfb7e4d518647c3b32c5273338940da0e67f
2020-04-06 13:59:08 -07: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
a89082c53d make bufutil funcs more efficient
Summary:
makes the split and trim functions for buf util batch delete the iobufs
instead of popping them out one by one.

Reviewed By: mjoras

Differential Revision: D18821896

fbshipit-source-id: 6e1543c4c1de298e4677043251ecd8a5601a2557
2019-12-05 14:15:11 -08:00
Subodh Iyengar
7ad8cea407 Remove iobufqueue from packetbuilder
Summary:
Get rid of IObufQueue usage in the PacketBuilder and replace it with a vanilla IOBuf.

This requires replacing QueueAppender with something else as well, so this diff adds a new class call BufAppender which does exactly the same things as a QueueAppender.

Having a BufAppender will allow us to avoid cloning the stream buffer in the future and avoid a clone during the write path.

Reviewed By: mjoras

Differential Revision: D18673517

fbshipit-source-id: 31fd7758688686371d038111514eb62d6b21672c
2019-11-28 21:38:28 -08:00
Matt Joras
cf783ae678 Replace IOBufQueue in retransmission buffer.
Summary:
`IOBufQueue` has some facilities for fast appending to the tail. This is not useful for us in the retransmission buffer usecase, and probably not at all. Flushing the tail cache from the `IOBufQueue` is expensive when we have to shuffle around the retransmission buffer queue on removal.

This diff replaces `IOBufQueue` with a bespoke version that only has some of the functionality.

This also changes the dependent peek APIs to use `IOBuf`s directly.

Reviewed By: siyengar, yangchi

Differential Revision: D18126437

fbshipit-source-id: a2fec0f45a72459855700c605bfd0d863a9067b7
2019-11-20 12:04:03 -08:00