mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-09 10:00:57 +03:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
fe92d2a5ce
commit
cf783ae678
@@ -135,6 +135,18 @@ folly::Optional<uint64_t> writeStreamFrameHeader(
|
||||
return folly::make_optional(dataLen);
|
||||
}
|
||||
|
||||
void writeStreamFrameData(
|
||||
PacketBuilderInterface& builder,
|
||||
const BufQueue& writeBuffer,
|
||||
uint64_t dataLen) {
|
||||
if (dataLen > 0) {
|
||||
Buf streamData;
|
||||
folly::io::Cursor cursor(writeBuffer.front());
|
||||
cursor.clone(streamData, dataLen);
|
||||
builder.insert(std::move(streamData));
|
||||
}
|
||||
}
|
||||
|
||||
void writeStreamFrameData(
|
||||
PacketBuilderInterface& builder,
|
||||
const folly::IOBufQueue& writeBuffer,
|
||||
|
||||
Reference in New Issue
Block a user