From 7d8b212a3c3368bc2f6507cb74664fc419eb9327 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Fri, 29 Jul 2022 12:02:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drtmp=E6=B1=87=E6=8A=A5?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=A4=AA=E5=B0=8F=E5=AF=BC=E8=87=B4=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E9=80=92=E5=BD=92=E7=9A=84bug=EF=BC=9A#1839?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpProtocol.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Rtmp/RtmpProtocol.cpp b/src/Rtmp/RtmpProtocol.cpp index 5eedb291..47439b4f 100644 --- a/src/Rtmp/RtmpProtocol.cpp +++ b/src/Rtmp/RtmpProtocol.cpp @@ -751,7 +751,8 @@ void RtmpProtocol::handle_chunk(RtmpPacket::Ptr packet) { } case MSG_WIN_SIZE: { - _windows_size = load_be32(&chunk_data.buffer[0]); + //如果窗口太小,会导致发送sendAcknowledgement时无限递归:https://github.com/ZLMediaKit/ZLMediaKit/issues/1839 + _windows_size = std::max(load_be32(&chunk_data.buffer[0]), 32 * 1024U); TraceL << "MSG_WIN_SIZE:" << _windows_size; break; } @@ -759,7 +760,7 @@ void RtmpProtocol::handle_chunk(RtmpPacket::Ptr packet) { case MSG_SET_PEER_BW: { _bandwidth = load_be32(&chunk_data.buffer[0]); _band_limit_type = chunk_data.buffer[4]; - TraceL << "MSG_SET_PEER_BW:" << _windows_size; + TraceL << "MSG_SET_PEER_BW:" << _bandwidth << " " << (int)_band_limit_type; break; }