获取设置日志时分段获取

This commit is contained in:
13038267101 2023-05-18 11:00:14 +08:00
parent ae50dc2396
commit 1b80a8226c
1 changed files with 19 additions and 1 deletions

View File

@ -1696,7 +1696,25 @@ int hg_scanner_239::get_device_log(string &logpath)
return ret;
str.resize(buffersize);
ret = io_->read_bulk(&str[0],&buffersize);
int block = buffersize,
total = buffersize,
index = 0;
while (total > 0)
{
block = 512 * 1024;
if (total< block)
{
block = total;
}
ret = io_->read_bulk(&str[index], &block);
if (ret != SCANNER_ERR_OK)
return ret;
index += block;
total -= block;
}
if (ret != SCANNER_ERR_OK)
return ret;