mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-25 15:43:13 +03:00
Update ACK_FREQUENCY frame
Summary: - Use varint reordering threshold (this is still being discussed, using varint until a decision is made) - Track server's minAckDelay on client - Track ack frequency frame sequence number - Improve frame parsing error logs - Add some unit tests Reviewed By: hanidamlaj Differential Revision: D38289108 fbshipit-source-id: 274e45115022ffd4e15b60dc57f77f1cce69bd82
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ce0873c14d
commit
1e594fe1ba
@@ -120,19 +120,19 @@ AckFrequencyFrame decodeAckFrequencyFrame(folly::io::Cursor& cursor) {
|
||||
quic::TransportErrorCode::FRAME_ENCODING_ERROR,
|
||||
quic::FrameType::ACK_FREQUENCY);
|
||||
}
|
||||
if (cursor.isAtEnd()) {
|
||||
auto reorderThreshold = decodeQuicInteger(cursor);
|
||||
if (!reorderThreshold) {
|
||||
throw QuicTransportException(
|
||||
"Bad ignore order",
|
||||
"Bad reorder threshold",
|
||||
quic::TransportErrorCode::FRAME_ENCODING_ERROR,
|
||||
quic::FrameType::ACK_FREQUENCY);
|
||||
}
|
||||
auto ignoreOrder = cursor.readBE<uint8_t>();
|
||||
|
||||
AckFrequencyFrame frame;
|
||||
frame.sequenceNumber = sequenceNumber->first;
|
||||
frame.packetTolerance = packetTolerance->first;
|
||||
frame.updateMaxAckDelay = updateMaxAckDelay->first;
|
||||
frame.ignoreOrder = ignoreOrder;
|
||||
frame.reorderThreshold = reorderThreshold->first;
|
||||
return frame;
|
||||
}
|
||||
|
||||
@@ -837,11 +837,13 @@ QuicFrame parseFrame(
|
||||
case FrameType::ACK_FREQUENCY:
|
||||
return QuicFrame(decodeAckFrequencyFrame(cursor));
|
||||
}
|
||||
} catch (const std::exception&) {
|
||||
} catch (const std::exception& e) {
|
||||
error = true;
|
||||
throw QuicTransportException(
|
||||
folly::to<std::string>(
|
||||
"Frame format invalid, type=", frameTypeInt->first),
|
||||
fmt::format(
|
||||
"Frame format invalid, type={}, error={}",
|
||||
frameTypeInt->first,
|
||||
e.what()),
|
||||
TransportErrorCode::FRAME_ENCODING_ERROR,
|
||||
frameType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user