diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-01-31 23:14:48 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2023-04-25 16:43:10 +0200 |
commit | 880e7b8ed6d666519cc39512a8d1b117506a5264 (patch) | |
tree | 1f995c299a142b223567f8599b9b7457ddfb966b | |
parent | 249ce283320fc277ed2499df33df476508fb3b1b (diff) |
TarArchive: Remove a duplicate constant and increase the buffer size
-rw-r--r-- | src/libutil/tarfile.cc | 4 | ||||
-rw-r--r-- | src/libutil/tarfile.hh | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc index 238d0a7a6..5060a8f24 100644 --- a/src/libutil/tarfile.cc +++ b/src/libutil/tarfile.cc @@ -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; diff --git a/src/libutil/tarfile.hh b/src/libutil/tarfile.hh index 24afb710a..237d18c31 100644 --- a/src/libutil/tarfile.hh +++ b/src/libutil/tarfile.hh @@ -24,6 +24,7 @@ struct TarArchive { ~TarArchive(); }; + void unpackTarfile(Source & source, const Path & destDir); void unpackTarfile(const Path & tarFile, const Path & destDir); |