获取设置日志时分段获取
This commit is contained in:
parent
ae50dc2396
commit
1b80a8226c
|
@ -1696,7 +1696,25 @@ int hg_scanner_239::get_device_log(string &logpath)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
str.resize(buffersize);
|
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)
|
if (ret != SCANNER_ERR_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue