TarArchive: Remove a duplicate constant and increase the buffer size

This commit is contained in:
Eelco Dolstra 2023-01-31 23:14:48 +01:00
parent 249ce28332
commit 880e7b8ed6
2 changed files with 3 additions and 2 deletions

View file

@ -17,7 +17,7 @@ static ssize_t callback_read(struct archive * archive, void * _self, const void
*buffer = self->buffer.data();
try {
return self->source->read((char *) self->buffer.data(), 4096);
return self->source->read((char *) self->buffer.data(), self->buffer.size());
} catch (EndOfFile &) {
return 0;
} catch (std::exception & err) {
@ -39,7 +39,7 @@ void TarArchive::check(int err, const std::string & reason)
throw Error(reason, archive_error_string(this->archive));
}
TarArchive::TarArchive(Source & source, bool raw) : buffer(4096)
TarArchive::TarArchive(Source & source, bool raw) : buffer(65536)
{
this->archive = archive_read_new();
this->source = &source;

View file

@ -24,6 +24,7 @@ struct TarArchive {
~TarArchive();
};
void unpackTarfile(Source & source, const Path & destDir);
void unpackTarfile(const Path & tarFile, const Path & destDir);