mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
BufFix: avoid may change data in splitter
This commit is contained in:
parent
208f57e2cd
commit
3e13e69724
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user