mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-06 20:23:43 +08:00
分包逻辑添加边界检测代码
This commit is contained in:
parent
ef46945de6
commit
8d50d3c397
|
@ -39,9 +39,12 @@ void HttpRequestSplitter::input(const char *data,size_t len) {
|
|||
const char *index = nullptr;
|
||||
_remain_data_size = len;
|
||||
while (_content_len == 0 && _remain_data_size > 0 && (index = onSearchPacketTail(ptr,_remain_data_size)) != nullptr) {
|
||||
if(index == ptr){
|
||||
if (index == ptr) {
|
||||
break;
|
||||
}
|
||||
if (index < ptr || index > ptr + _remain_data_size) {
|
||||
throw std::out_of_range("上层分包逻辑异常");
|
||||
}
|
||||
//_content_len == 0,这是请求头
|
||||
const char *header_ptr = ptr;
|
||||
ssize_t header_size = index - ptr;
|
||||
|
|
Loading…
Reference in New Issue
Block a user