Skip to content

Commit b62b79d

Browse files
committed
allow unknown frames
1 parent d9420f1 commit b62b79d

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

ChangeLog.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# Changelog
1+
#Changelog
22

33
All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7-
## [1.10.0-beta.3] - TBD
7+
## [1.10.0-beta.4] - TBD
8+
9+
### Fixes
10+
11+
* Correctly track received bytes in HTTP/2 client statistics
12+
* Ignore unknown HTTP/2 frame types instead of treating them as fatal errors (forward compatibility)
13+
14+
## [1.10.0-beta.3] - 2025-12-21
815

916
### Changes
1017

@@ -425,27 +432,26 @@ All notable changes to this project will be documented in this file.
425432

426433
- Added isTopicEmpty function;
427434

428-
### Changed
435+
## #Changed
429436

430-
- Update the ubuntu Dockerfile;
437+
- Update the ubuntu Dockerfile;
431438

432439
- Add optional Criteria && || operator support;
433440

434-
- Bump actions/checkout from 3 to 4;
441+
- Bump actions / checkout from 3 to 4;
435442

436-
- Make & and * directly adjacent to variable names;
443+
- Make & and *directly adjacent to variable names;
437444

438-
- Use wss://echo.websocket.events/.ws in WebSocket client example;
445+
- Use wss: // echo.websocket.events/.ws in WebSocket client example;
439446

440-
- Change logs in the AccessLogger plugin to TRACE level;
447+
-Change logs in the AccessLogger plugin to TRACE level;
441448

442-
### Fixed
449+
## #Fixed
443450

444-
- Fix an error in the secureRandomString function;
451+
- Fix an error in the secureRandomString function;
445452

446453
- FIX int mapping to int64_t instead of uint64_t;
447454

448-
449455
## [1.9.0-rc.1] - 2023-09-23
450456

451457
### API changes list
@@ -1488,7 +1494,8 @@ All notable changes to this project will be documented in this file.
14881494

14891495
- Destroy DNS resolver of HttpClient in the correct thread.
14901496

1491-
- Add the header <cctype> to resolve build errors in VS2017.
1497+
- Add the header <
1498+
cctype & gt; to resolve build errors in VS2017.
14921499

14931500
## [1.0.0-beta18] - 2020-06-14
14941501

@@ -1830,7 +1837,7 @@ All notable changes to this project will be documented in this file.
18301837

18311838
- Add two methods to control if the Server header or the Date header is sent to clients with HTTP responses.
18321839
* void HttpAppFramework::enableServerHeader(bool);
1833-
* void HttpAppFramework::enableDateHeader(bool);
1840+
*void HttpAppFramework::enableDateHeader(bool);
18341841

18351842
### Changed
18361843

lib/src/Http2Transport.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -625,12 +625,13 @@ parseH2Frame(trantor::MsgBuffer *msg)
625625
// MSB is reserved for future use
626626
const uint32_t streamId = header.readU32BE() & ((1U << 31) - 1);
627627

628-
if (type >= (uint8_t)H2FrameType::NumEntries)
629-
{
630-
// TODO: Handle fatal protocol error
631-
LOG_TRACE << "Unsupported H2 frame type: " << (int)type;
632-
return {std::nullopt, streamId, 0, true, 0};
633-
}
628+
// This check is not need as HTTP/2 allows unknown frame types to be
629+
// ignored for forward compatibility.
630+
// if (type >= (uint8_t)H2FrameType::NumEntries)
631+
// {
632+
// LOG_TRACE << "Unsupported H2 frame type: " << (int)type;
633+
// return {std::nullopt, streamId, 0, true, 0};
634+
// }
634635

635636
LOG_TRACE << "H2 frame: length=" << length << " type=" << (int)type
636637
<< " flags=" << (int)flags << " streamId=" << streamId;
@@ -657,7 +658,7 @@ parseH2Frame(trantor::MsgBuffer *msg)
657658
frame = RstStreamFrame::parse(payload, flags);
658659
else
659660
{
660-
LOG_WARN << "Unsupported H2 frame type: " << (int)type;
661+
LOG_TRACE << "Unsupported H2 frame type: " << (int)type;
661662
msg->retrieve(length + 9);
662663
return {std::nullopt, streamId, 0, false, 0};
663664
}

0 commit comments

Comments
 (0)