BufFix: avoid may change data in splitter

This commit is contained in:
xiongziliang 2024-03-24 22:01:56 +08:00
parent 208f57e2cd
commit 3e13e69724

View File

@ -65,18 +65,18 @@ void HttpRequestSplitter::input(const char *data,size_t len) {
_content_len = onRecvHeader(header_ptr, header_size);
}
if(_remain_data_size <= 0){
//没有剩余数据,清空缓存
_remain_data.clear();
return;
}
/*
*
* HttpRequestSplitter::reset()
*/
tail_ref = tail_tmp;
if(_remain_data_size <= 0){
//没有剩余数据,清空缓存
_remain_data.clear();
return;
}
if(_content_len == 0){
//尚未找到http头缓存定位到剩余数据部分
_remain_data.assign(ptr,_remain_data_size);