forked from lix-project/lix
TarArchive: Remove a duplicate constant and increase the buffer size
This commit is contained in:
parent
249ce28332
commit
880e7b8ed6
|
@ -17,7 +17,7 @@ static ssize_t callback_read(struct archive * archive, void * _self, const void
|
||||||
*buffer = self->buffer.data();
|
*buffer = self->buffer.data();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return self->source->read((char *) self->buffer.data(), 4096);
|
return self->source->read((char *) self->buffer.data(), self->buffer.size());
|
||||||
} catch (EndOfFile &) {
|
} catch (EndOfFile &) {
|
||||||
return 0;
|
return 0;
|
||||||
} catch (std::exception & err) {
|
} 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));
|
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->archive = archive_read_new();
|
||||||
this->source = &source;
|
this->source = &source;
|
||||||
|
|
|
@ -24,6 +24,7 @@ struct TarArchive {
|
||||||
|
|
||||||
~TarArchive();
|
~TarArchive();
|
||||||
};
|
};
|
||||||
|
|
||||||
void unpackTarfile(Source & source, const Path & destDir);
|
void unpackTarfile(Source & source, const Path & destDir);
|
||||||
|
|
||||||
void unpackTarfile(const Path & tarFile, const Path & destDir);
|
void unpackTarfile(const Path & tarFile, const Path & destDir);
|
||||||
|
|
Loading…
Reference in a new issue