mirror of https://github.com/vitalif/zbackup
LZO and backup exchanger working together
Additionally fixed segfault introduced in previous commitmaster
parent
629718f9bc
commit
cc84486668
|
@ -43,9 +43,7 @@ void Creator::write( std::string const & fileName, EncryptionKey const & key,
|
|||
|
||||
os.writeRandomIv();
|
||||
|
||||
FileHeader header;
|
||||
header.set_version( FileFormatVersion );
|
||||
Message::serialize( header, os );
|
||||
Message::serialize( reader.getBundleHeader(), os );
|
||||
|
||||
Message::serialize( reader.getBundleInfo(), os );
|
||||
os.writeAdler32();
|
||||
|
@ -153,7 +151,6 @@ Reader::Reader( string const & fileName, EncryptionKey const & key, bool prohibi
|
|||
{
|
||||
is.consumeRandomIv();
|
||||
|
||||
BundleFileHeader header;
|
||||
Message::parse( header, is );
|
||||
|
||||
if ( header.version() >= FileFormatVersionFirstUnsupported )
|
||||
|
|
|
@ -49,6 +49,7 @@ STATIC_ASSERT( sizeof( Id ) == IdSize );
|
|||
class Reader: NoCopy
|
||||
{
|
||||
BundleInfo info;
|
||||
BundleFileHeader header;
|
||||
/// Unpacked payload
|
||||
string payload;
|
||||
/// Maps chunk id blob to its contents and size
|
||||
|
@ -71,6 +72,8 @@ public:
|
|||
bool get( string const & chunkId, string & chunkData, size_t & chunkDataSize );
|
||||
BundleInfo getBundleInfo()
|
||||
{ return info; }
|
||||
BundleFileHeader getBundleHeader()
|
||||
{ return header; }
|
||||
string getPayload()
|
||||
{ return payload; }
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ private:
|
|||
}
|
||||
|
||||
// we use our own buffer
|
||||
size_t bufferSize, outputSize = suggestOutputSize( dataIn, availIn );
|
||||
size_t bufferSize = suggestOutputSize( dataIn, availIn );
|
||||
do {
|
||||
accDataOut.resize(bufferSize);
|
||||
|
||||
|
|
Loading…
Reference in New Issue