diff --git a/3rdpart/ZLToolKit b/3rdpart/ZLToolKit index 88bc73aa..8afa63c3 160000 --- a/3rdpart/ZLToolKit +++ b/3rdpart/ZLToolKit @@ -1 +1 @@ -Subproject commit 88bc73aa6b7e04e04ca45f4fdbe36d4e359088bf +Subproject commit 8afa63c31522e031c3d4857f0c723ee4e97447fc diff --git a/src/Http/HttpRequestSplitter.cpp b/src/Http/HttpRequestSplitter.cpp index 70a713e6..93bd0dae 100644 --- a/src/Http/HttpRequestSplitter.cpp +++ b/src/Http/HttpRequestSplitter.cpp @@ -19,9 +19,13 @@ static constexpr size_t kMaxCacheSize = 1 * 1024 * 1024; namespace mediakit { void HttpRequestSplitter::input(const char *data,size_t len) { - if (remainDataSize() > kMaxCacheSize) { - //缓存太多数据无法处理则上抛异常 - throw std::out_of_range("remain data size is too huge:" + to_string(remainDataSize())); + { + auto size = 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; if(!_remain_data.empty()){