From de92b3be2e6894c353816c6bd29d2a4768ccb92f Mon Sep 17 00:00:00 2001
From: oatoam <31235342+oatoam@users.noreply.github.com>
Date: Fri, 24 Jun 2022 11:46:17 +0800
Subject: [PATCH] fix unrecoverable Err(Overflow) in websocket frame parser
(#2790)
---
actix-http/CHANGES.md | 6 +++++
actix-http/src/ws/frame.rs | 49 +++++++++++++++++++++++++++-----------
2 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md
index 209f86ca..dd6051b8 100644
--- a/actix-http/CHANGES.md
+++ b/actix-http/CHANGES.md
@@ -1,8 +1,14 @@
# Changes
## Unreleased - 2022-xx-xx
+### Fixed
+- Websocket parser no longer throws endless overflow errors after receiving an oversized frame. [#2790]
+
+### Changed
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.
+[#2790]: https://github.com/actix/actix-web/pull/2790
+
## 3.1.0 - 2022-06-11
### Changed
diff --git a/actix-http/src/ws/frame.rs b/actix-http/src/ws/frame.rs
index 17e34e2b..3659b6c3 100644
--- a/actix-http/src/ws/frame.rs
+++ b/actix-http/src/ws/frame.rs
@@ -17,7 +17,6 @@ impl Parser {
fn parse_metadata(
src: &[u8],
server: bool,
- max_size: usize,
) -> Result