1 Star 0 Fork 24

zhangxingrong/trafficserver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fixed-h2spec-6.4.3-test.patch 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
zhangxingrong 提交于 2024-07-15 16:39 +08:00 . add some upstream patchs
From fd8d4130b6ce7eb01d69e000c38d3e4bf8b69a69 Mon Sep 17 00:00:00 2001
From: Masakazu Kitajo <maskit@apache.org>
Date: Tue, 17 Oct 2023 03:29:57 +0900
Subject: [PATCH] Fixed h2spec 6.4.3 test (#10584) (#10621)
Should respond with FRAME_SIZE_ERROR when receiving reset frame of
incorrect size before looking to see if the stream exists.
(cherry picked from commit bb951e905e7844f304e6635a84acbd0734aed251)
Conflicts:
proxy/http2/Http2ConnectionState.cc
Co-authored-by: Bryan Call <bcall@apache.org>
---
proxy/http2/Http2ConnectionState.cc | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index dcfab9b6747..675cdbc4358 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -521,6 +521,13 @@ rcv_rst_stream_frame(Http2ConnectionState &cstate, const Http2Frame &frame)
"reset access stream with invalid id");
}
+ // A RST_STREAM frame with a length other than 4 octets MUST be treated
+ // as a connection error (Section 5.4.1) of type FRAME_SIZE_ERROR.
+ if (frame.header().length != HTTP2_RST_STREAM_LEN) {
+ return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_FRAME_SIZE_ERROR,
+ "reset frame wrong length");
+ }
+
Http2Stream *stream = cstate.find_stream(stream_id);
if (stream == nullptr) {
if (cstate.is_valid_streamid(stream_id)) {
@@ -531,13 +538,6 @@ rcv_rst_stream_frame(Http2ConnectionState &cstate, const Http2Frame &frame)
}
}
- // A RST_STREAM frame with a length other than 4 octets MUST be treated
- // as a connection error (Section 5.4.1) of type FRAME_SIZE_ERROR.
- if (frame.header().length != HTTP2_RST_STREAM_LEN) {
- return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, Http2ErrorCode::HTTP2_ERROR_FRAME_SIZE_ERROR,
- "reset frame wrong length");
- }
-
// Update RST_STREAM frame count per minute
cstate.increment_received_rst_stream_frame_count();
// Close this connection if its RST_STREAM frame count exceeds a limit
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangxingrong/trafficserver.git
git@gitee.com:zhangxingrong/trafficserver.git
zhangxingrong
trafficserver
trafficserver
master

搜索帮助