LZO and backup exchanger working together

Additionally fixed segfault introduced in previous commit
master
Am1GO 2014-12-09 17:42:41 +03:00
parent 629718f9bc
commit cc84486668
3 changed files with 5 additions and 5 deletions

View File

@ -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 )

View File

@ -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; }

View File

@ -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);