mirror of
https://github.com/NixOS/nix
synced 2025-07-05 16:31:47 +02:00
TarArchive: Remove a duplicate constant and increase the buffer size
This commit is contained in:
parent
aaf8b1b150
commit
b14830b23a
2 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -21,6 +21,7 @@ struct TarArchive {
|
|||
|
||||
~TarArchive();
|
||||
};
|
||||
|
||||
void unpackTarfile(Source & source, const Path & destDir);
|
||||
|
||||
void unpackTarfile(const Path & tarFile, const Path & destDir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue