修复rtmp汇报窗口太小导致循环递归的bug:#1839

This commit is contained in:
ziyue 2022-07-29 12:02:00 +08:00
parent 9ea98642c1
commit 7d8b212a3c

View File

@ -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;
}