Terrasync: tarball extraction, use larger buffer
Use a 1MB buffer, 2kByte is very 1979 :)
This commit is contained in:
parent
11da8b33f9
commit
9305417207
@ -462,13 +462,15 @@ public:
|
|||||||
SGPath extractDir = p.dir();
|
SGPath extractDir = p.dir();
|
||||||
ArchiveExtractor ex(extractDir);
|
ArchiveExtractor ex(extractDir);
|
||||||
|
|
||||||
uint8_t *buf = (uint8_t *)alloca(2048);
|
const size_t bufSize = 1024 * 1024;
|
||||||
|
uint8_t* buf = (uint8_t*)malloc(bufSize);
|
||||||
while (!f.eof()) {
|
while (!f.eof()) {
|
||||||
size_t bufSize = f.read((char *)buf, 2048);
|
size_t rd = f.read((char*)buf, bufSize);
|
||||||
ex.extractBytes(buf, bufSize);
|
ex.extractBytes(buf, rd);
|
||||||
}
|
}
|
||||||
|
|
||||||
ex.flush();
|
ex.flush();
|
||||||
|
free(buf);
|
||||||
if (! ex.isAtEndOfArchive()) {
|
if (! ex.isAtEndOfArchive()) {
|
||||||
SG_LOG(SG_TERRASYNC, SG_ALERT, "Corrupt tarball " << p);
|
SG_LOG(SG_TERRASYNC, SG_ALERT, "Corrupt tarball " << p);
|
||||||
_repository->failedToUpdateChild(
|
_repository->failedToUpdateChild(
|
||||||
|
Loading…
Reference in New Issue
Block a user