1. 修复SDK缓冲区问题
This commit is contained in:
parent
2e585032fe
commit
51f769587b
@ -547,7 +547,7 @@ bool HDSDKPrivate::ParseReadData(const std::string &data)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string buff = detail::Mid(data, 0, len);
|
std::string buff = detail::Mid(readBuff_, 0, len);
|
||||||
detail::Remove(readBuff_, 0, len);
|
detail::Remove(readBuff_, 0, len);
|
||||||
|
|
||||||
bool result = true;
|
bool result = true;
|
||||||
@ -636,8 +636,8 @@ bool HDSDKPrivate::ParseSDKCmdAnswer(std::string &&data)
|
|||||||
|
|
||||||
sdkBuff_.append(data);
|
sdkBuff_.append(data);
|
||||||
if (total <= sdkBuff_.size()) {
|
if (total <= sdkBuff_.size()) {
|
||||||
std::string buff(std::move(sdkBuff_));
|
std::string buff(sdkBuff_.substr(0, total));
|
||||||
sdkBuff_.clear();
|
sdkBuff_ = sdkBuff_.substr(total);
|
||||||
ReadXml(buff, 0);
|
ReadXml(buff, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user