mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
分包器缓存太多时主动清空数据
This commit is contained in:
parent
5832de7ed8
commit
3cba8fca79
@ -1 +1 @@
|
|||||||
Subproject commit 88bc73aa6b7e04e04ca45f4fdbe36d4e359088bf
|
Subproject commit 8afa63c31522e031c3d4857f0c723ee4e97447fc
|
@ -19,9 +19,13 @@ static constexpr size_t kMaxCacheSize = 1 * 1024 * 1024;
|
|||||||
namespace mediakit {
|
namespace mediakit {
|
||||||
|
|
||||||
void HttpRequestSplitter::input(const char *data,size_t len) {
|
void HttpRequestSplitter::input(const char *data,size_t len) {
|
||||||
if (remainDataSize() > kMaxCacheSize) {
|
{
|
||||||
//缓存太多数据无法处理则上抛异常
|
auto size = remainDataSize();
|
||||||
throw std::out_of_range("remain data size is too huge:" + to_string(remainDataSize()));
|
if (size > kMaxCacheSize) {
|
||||||
|
//缓存太多数据无法处理则上抛异常
|
||||||
|
reset();
|
||||||
|
throw std::out_of_range("remain data size is too huge, now cleared:" + to_string(size));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const char *ptr = data;
|
const char *ptr = data;
|
||||||
if(!_remain_data.empty()){
|
if(!_remain_data.empty()){
|
||||||
|
Loading…
Reference in New Issue
Block a user