You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-13 01:00:23 +02:00
Rename "gzip" to "gz".
"gz" was used as the extension but "gzip" was generally used for function and type naming. With a new compression format on the way, it makes sense to standardize on a single abbreviation to represent a compression format in the code. Since the extension is standard and we must use it, also use the extension for all naming.
This commit is contained in:
@ -111,7 +111,7 @@
|
||||
</table-row>
|
||||
|
||||
<table-row>
|
||||
<table-cell>common/compress/gzip</table-cell>
|
||||
<table-cell>common/compress/gz</table-cell>
|
||||
<table-cell>16/16 (100.0%)</table-cell>
|
||||
<table-cell>24/24 (100.0%)</table-cell>
|
||||
<table-cell>163/163 (100.0%)</table-cell>
|
||||
|
@ -419,7 +419,7 @@ sub reconstruct
|
||||
my $oFileIo = storageRepo()->openRead(
|
||||
$strArchiveFilePath,
|
||||
{rhyFilter => $strArchiveFile =~ ('\.' . COMPRESS_EXT . '$') ?
|
||||
[{strClass => STORAGE_FILTER_GZIP, rxyParam => [STORAGE_DECOMPRESS, false]}] : undef,
|
||||
[{strClass => STORAGE_FILTER_GZ, rxyParam => [STORAGE_DECOMPRESS, false]}] : undef,
|
||||
strCipherPass => $self->cipherPassSub()});
|
||||
$oFileIo->open();
|
||||
|
||||
|
@ -50,8 +50,8 @@ use constant CIPHER_MAGIC => 'Salted__
|
||||
####################################################################################################################################
|
||||
use constant STORAGE_FILTER_CIPHER_BLOCK => 'pgBackRest::Storage::Filter::CipherBlock';
|
||||
push @EXPORT, qw(STORAGE_FILTER_CIPHER_BLOCK);
|
||||
use constant STORAGE_FILTER_GZIP => 'pgBackRest::Storage::Filter::Gzip';
|
||||
push @EXPORT, qw(STORAGE_FILTER_GZIP);
|
||||
use constant STORAGE_FILTER_GZ => 'pgBackRest::Storage::Filter::Gz';
|
||||
push @EXPORT, qw(STORAGE_FILTER_GZ);
|
||||
use constant STORAGE_FILTER_SHA => 'pgBackRest::Storage::Filter::Sha';
|
||||
push @EXPORT, qw(STORAGE_FILTER_SHA);
|
||||
|
||||
|
@ -43,9 +43,9 @@ my @stryCFile =
|
||||
'LibC.c',
|
||||
|
||||
'command/command.c',
|
||||
'common/compress/gzip/common.c',
|
||||
'common/compress/gzip/compress.c',
|
||||
'common/compress/gzip/decompress.c',
|
||||
'common/compress/gz/common.c',
|
||||
'common/compress/gz/compress.c',
|
||||
'common/compress/gz/decompress.c',
|
||||
'common/crypto/cipherBlock.c',
|
||||
'common/crypto/common.c',
|
||||
'common/crypto/hash.c',
|
||||
|
@ -2,8 +2,8 @@
|
||||
Storage XS Header
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/assert.h"
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/io/filter/size.h"
|
||||
#include "common/memContext.h"
|
||||
@ -132,16 +132,16 @@ storageFilterXsAdd(IoFilterGroup *filterGroup, const String *filter, const Strin
|
||||
{
|
||||
ioFilterGroupAdd(filterGroup, ioSizeNew());
|
||||
}
|
||||
else if (strEqZ(filter, "pgBackRest::Storage::Filter::Gzip"))
|
||||
else if (strEqZ(filter, "pgBackRest::Storage::Filter::Gz"))
|
||||
{
|
||||
if (strEqZ(varStr(varLstGet(paramList, 0)), "compress"))
|
||||
{
|
||||
ioFilterGroupAdd(
|
||||
filterGroup, gzipCompressNew(varUIntForce(varLstGet(paramList, 2)), varBoolForce(varLstGet(paramList, 1))));
|
||||
filterGroup, gzCompressNew(varUIntForce(varLstGet(paramList, 2)), varBoolForce(varLstGet(paramList, 1))));
|
||||
}
|
||||
else
|
||||
{
|
||||
ioFilterGroupAdd(filterGroup, gzipDecompressNew(varBoolForce(varLstGet(paramList, 1))));
|
||||
ioFilterGroupAdd(filterGroup, gzDecompressNew(varBoolForce(varLstGet(paramList, 1))));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -75,9 +75,9 @@ SRCS = \
|
||||
command/stanza/delete.c \
|
||||
command/stanza/upgrade.c \
|
||||
command/storage/list.c \
|
||||
common/compress/gzip/common.c \
|
||||
common/compress/gzip/compress.c \
|
||||
common/compress/gzip/decompress.c \
|
||||
common/compress/gz/common.c \
|
||||
common/compress/gz/compress.c \
|
||||
common/compress/gz/decompress.c \
|
||||
common/crypto/cipherBlock.c \
|
||||
common/crypto/common.c \
|
||||
common/crypto/hash.c \
|
||||
@ -215,7 +215,7 @@ clean:
|
||||
command/archive/common.o: command/archive/common.c build.auto.h command/archive/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/fork.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h postgres/version.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/common.c -o command/archive/common.o
|
||||
|
||||
command/archive/get/file.o: command/archive/get/file.c build.auto.h command/archive/common.h command/archive/get/file.h command/control/common.h common/assert.h common/compress/gzip/common.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/get/file.o: command/archive/get/file.c build.auto.h command/archive/common.h command/archive/get/file.h command/control/common.h common/assert.h common/compress/gz/common.h common/compress/gz/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/get/file.c -o command/archive/get/file.o
|
||||
|
||||
command/archive/get/get.o: command/archive/get/get.c build.auto.h command/archive/common.h command/archive/get/file.h command/archive/get/protocol.h command/command.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
@ -224,7 +224,7 @@ command/archive/get/get.o: command/archive/get/get.c build.auto.h command/archiv
|
||||
command/archive/get/protocol.o: command/archive/get/protocol.c build.auto.h command/archive/get/file.h command/archive/get/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/get/protocol.c -o command/archive/get/protocol.o
|
||||
|
||||
command/archive/push/file.o: command/archive/push/file.c build.auto.h command/archive/common.h command/archive/push/file.h command/control/common.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/archive/push/file.o: command/archive/push/file.c build.auto.h command/archive/common.h command/archive/push/file.h command/control/common.h common/assert.h common/compress/gz/common.h common/compress/gz/compress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/push/file.c -o command/archive/push/file.o
|
||||
|
||||
command/archive/push/protocol.o: command/archive/push/protocol.c build.auto.h command/archive/push/file.h command/archive/push/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
@ -233,13 +233,13 @@ command/archive/push/protocol.o: command/archive/push/protocol.c build.auto.h co
|
||||
command/archive/push/push.o: command/archive/push/push.c build.auto.h command/archive/common.h command/archive/push/file.h command/archive/push/protocol.h command/command.h command/control/common.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h common/wait.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/exec.h info/info.h info/infoArchive.h info/infoPg.h postgres/interface.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/archive/push/push.c -o command/archive/push/push.o
|
||||
|
||||
command/backup/backup.o: command/backup/backup.c build.auto.h command/archive/common.h command/backup/backup.h command/backup/common.h command/backup/file.h command/backup/protocol.h command/check/common.h command/control/common.h command/stanza/common.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
command/backup/backup.o: command/backup/backup.c build.auto.h command/archive/common.h command/backup/backup.h command/backup/common.h command/backup/file.h command/backup/protocol.h command/check/common.h command/control/common.h command/stanza/common.h common/assert.h common/compress/gz/common.h common/compress/gz/compress.h common/compress/gz/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/ini.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h db/db.h db/helper.h info/info.h info/infoArchive.h info/infoBackup.h info/infoPg.h info/manifest.h postgres/client.h postgres/interface.h postgres/version.h protocol/client.h protocol/command.h protocol/helper.h protocol/parallel.h protocol/parallelJob.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/backup/backup.c -o command/backup/backup.o
|
||||
|
||||
command/backup/common.o: command/backup/common.c build.auto.h command/backup/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/string.h common/type/stringz.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/backup/common.c -o command/backup/common.o
|
||||
|
||||
command/backup/file.o: command/backup/file.c build.auto.h command/backup/file.h command/backup/pageChecksum.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/backup/file.o: command/backup/file.c build.auto.h command/backup/file.h command/backup/pageChecksum.h common/assert.h common/compress/gz/common.h common/compress/gz/compress.h common/compress/gz/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h postgres/interface.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/backup/file.c -o command/backup/file.o
|
||||
|
||||
command/backup/pageChecksum.o: command/backup/pageChecksum.c build.auto.h command/backup/pageChecksum.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h postgres/pageChecksum.h
|
||||
@ -281,7 +281,7 @@ command/local/local.o: command/local/local.c build.auto.h command/archive/get/pr
|
||||
command/remote/remote.o: command/remote/remote.c build.auto.h command/control/common.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleRead.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h config/protocol.h db/protocol.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h storage/remote/protocol.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/remote/remote.c -o command/remote/remote.o
|
||||
|
||||
command/restore/file.o: command/restore/file.c build.auto.h command/restore/file.h common/assert.h common/compress/gzip/common.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
command/restore/file.o: command/restore/file.c build.auto.h command/restore/file.h common/assert.h common/compress/gz/common.h common/compress/gz/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/restore/file.c -o command/restore/file.o
|
||||
|
||||
command/restore/protocol.o: command/restore/protocol.c build.auto.h command/restore/file.h command/restore/protocol.h common/assert.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/io.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
@ -305,14 +305,14 @@ command/stanza/upgrade.o: command/stanza/upgrade.c build.auto.h command/backup/c
|
||||
command/storage/list.o: command/storage/list.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/handleWrite.h common/io/read.h common/io/write.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h storage/helper.h storage/info.h storage/read.h storage/storage.h storage/write.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c command/storage/list.c -o command/storage/list.o
|
||||
|
||||
common/compress/gzip/common.o: common/compress/gzip/common.c build.auto.h common/assert.h common/compress/gzip/common.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/convert.h common/type/stringz.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/compress/gzip/common.c -o common/compress/gzip/common.o
|
||||
common/compress/gz/common.o: common/compress/gz/common.c build.auto.h common/assert.h common/compress/gz/common.h common/debug.h common/error.auto.h common/error.h common/logLevel.h common/memContext.h common/stackTrace.h common/type/convert.h common/type/stringz.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/compress/gz/common.c -o common/compress/gz/common.o
|
||||
|
||||
common/compress/gzip/compress.o: common/compress/gzip/compress.c build.auto.h common/assert.h common/compress/gzip/common.h common/compress/gzip/compress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/compress/gzip/compress.c -o common/compress/gzip/compress.o
|
||||
common/compress/gz/compress.o: common/compress/gz/compress.c build.auto.h common/assert.h common/compress/gz/common.h common/compress/gz/compress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/compress/gz/compress.c -o common/compress/gz/compress.o
|
||||
|
||||
common/compress/gzip/decompress.o: common/compress/gzip/decompress.c build.auto.h common/assert.h common/compress/gzip/common.h common/compress/gzip/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/compress/gzip/decompress.c -o common/compress/gzip/decompress.o
|
||||
common/compress/gz/decompress.o: common/compress/gz/decompress.c build.auto.h common/assert.h common/compress/gz/common.h common/compress/gz/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/compress/gz/decompress.c -o common/compress/gz/decompress.o
|
||||
|
||||
common/crypto/cipherBlock.o: common/crypto/cipherBlock.c build.auto.h common/assert.h common/crypto/cipherBlock.h common/crypto/common.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/filter.intern.h common/io/filter/group.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c common/crypto/cipherBlock.c -o common/crypto/cipherBlock.o
|
||||
@ -584,16 +584,16 @@ storage/posix/write.o: storage/posix/write.c build.auto.h common/assert.h common
|
||||
storage/read.o: storage/read.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/string.h common/type/stringz.h common/type/variant.h common/type/variantList.h storage/read.h storage/read.intern.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/read.c -o storage/read.o
|
||||
|
||||
storage/remote/protocol.o: storage/remote/protocol.c build.auto.h command/backup/pageChecksum.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/sink.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/remote/protocol.o: storage/remote/protocol.c build.auto.h command/backup/pageChecksum.h common/assert.h common/compress/gz/compress.h common/compress/gz/decompress.h common/crypto/cipherBlock.h common/crypto/common.h common/crypto/hash.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/filter/sink.h common/io/filter/size.h common/io/io.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/lock.h common/log.h common/logLevel.h common/memContext.h common/regExp.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h config/config.auto.h config/config.h config/define.auto.h config/define.h protocol/client.h protocol/command.h protocol/helper.h protocol/server.h storage/helper.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/protocol.c -o storage/remote/protocol.o
|
||||
|
||||
storage/remote/read.o: storage/remote/read.c build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/read.h storage/remote/storage.h storage/remote/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/remote/read.o: storage/remote/read.c build.auto.h common/assert.h common/compress/gz/compress.h common/compress/gz/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/read.h storage/remote/storage.h storage/remote/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/read.c -o storage/remote/read.o
|
||||
|
||||
storage/remote/storage.o: storage/remote/storage.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/json.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/read.h storage/remote/storage.h storage/remote/storage.intern.h storage/remote/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/storage.c -o storage/remote/storage.o
|
||||
|
||||
storage/remote/write.o: storage/remote/write.c build.auto.h common/assert.h common/compress/gzip/compress.h common/compress/gzip/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/storage.h storage/remote/storage.intern.h storage/remote/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
storage/remote/write.o: storage/remote/write.c build.auto.h common/assert.h common/compress/gz/compress.h common/compress/gz/decompress.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h protocol/client.h protocol/command.h protocol/server.h storage/info.h storage/read.h storage/read.intern.h storage/remote/protocol.h storage/remote/storage.h storage/remote/storage.intern.h storage/remote/write.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CMAKE) -c storage/remote/write.c -o storage/remote/write.o
|
||||
|
||||
storage/s3/read.o: storage/s3/read.c build.auto.h common/assert.h common/debug.h common/error.auto.h common/error.h common/io/filter/filter.h common/io/filter/group.h common/io/http/client.h common/io/http/header.h common/io/http/query.h common/io/read.h common/io/read.intern.h common/io/write.h common/io/write.intern.h common/log.h common/logLevel.h common/macro.h common/memContext.h common/object.h common/stackTrace.h common/time.h common/type/buffer.h common/type/convert.h common/type/keyValue.h common/type/list.h common/type/param.h common/type/string.h common/type/stringList.h common/type/stringz.h common/type/variant.h common/type/variantList.h storage/info.h storage/read.h storage/read.intern.h storage/s3/read.h storage/s3/storage.h storage/s3/storage.intern.h storage/storage.h storage/storage.intern.h storage/write.h storage/write.intern.h version.h
|
||||
|
@ -6,8 +6,8 @@ Archive Get File
|
||||
#include "command/archive/get/file.h"
|
||||
#include "command/archive/common.h"
|
||||
#include "command/control/common.h"
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/group.h"
|
||||
@ -160,9 +160,9 @@ archiveGetFile(
|
||||
}
|
||||
|
||||
// If file is compressed then add the decompression filter
|
||||
if (strEndsWithZ(archiveGetCheckResult.archiveFileActual, "." GZIP_EXT))
|
||||
if (strEndsWithZ(archiveGetCheckResult.archiveFileActual, "." GZ_EXT))
|
||||
{
|
||||
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(destination)), gzipDecompressNew(false));
|
||||
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(destination)), gzDecompressNew(false));
|
||||
compressible = false;
|
||||
}
|
||||
|
||||
|
@ -6,8 +6,8 @@ Archive Push File
|
||||
#include "command/archive/push/file.h"
|
||||
#include "command/archive/common.h"
|
||||
#include "command/control/common.h"
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/crypto/hash.h"
|
||||
#include "common/debug.h"
|
||||
@ -116,8 +116,8 @@ archivePushFile(
|
||||
// If the file will be compressed then add compression filter
|
||||
if (isSegment && compress)
|
||||
{
|
||||
strCat(archiveDestination, "." GZIP_EXT);
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(source)), gzipCompressNew(compressLevel, false));
|
||||
strCat(archiveDestination, "." GZ_EXT);
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(source)), gzCompressNew(compressLevel, false));
|
||||
compressible = false;
|
||||
}
|
||||
|
||||
|
@ -17,9 +17,9 @@ Backup Command
|
||||
#include "command/check/common.h"
|
||||
#include "command/stanza/common.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/size.h"
|
||||
#include "common/log.h"
|
||||
@ -124,7 +124,7 @@ backupLabelCreate(BackupType type, const String *backupLabelPrior, time_t timest
|
||||
storageRepo(),
|
||||
strNewFmt(STORAGE_REPO_BACKUP "/" BACKUP_PATH_HISTORY "/%s", strPtr(strLstGet(historyYearList, 0))),
|
||||
.expression = strNewFmt(
|
||||
"%s\\.manifest\\." GZIP_EXT "$",
|
||||
"%s\\.manifest\\." GZ_EXT "$",
|
||||
strPtr(backupRegExpP(.full = true, .differential = true, .incremental = true, .noAnchorEnd = true)))),
|
||||
sortOrderDesc);
|
||||
|
||||
@ -577,7 +577,7 @@ void backupResumeCallback(void *data, const StorageInfo *info)
|
||||
{
|
||||
// If the backup is compressed then strip off the extension before doing the lookup
|
||||
if (resumeData->compressed)
|
||||
manifestName = strSubN(manifestName, 0, strSize(manifestName) - sizeof(GZIP_EXT));
|
||||
manifestName = strSubN(manifestName, 0, strSize(manifestName) - sizeof(GZ_EXT));
|
||||
|
||||
// Find the file in both manifests
|
||||
const ManifestFile *file = manifestFileFindDefault(resumeData->manifest, manifestName, NULL);
|
||||
@ -926,7 +926,7 @@ backupFilePut(BackupData *backupData, Manifest *manifest, const String *name, ti
|
||||
storageRepoWrite(),
|
||||
strNewFmt(
|
||||
STORAGE_REPO_BACKUP "/%s/%s%s", strPtr(manifestData(manifest)->backupLabel), strPtr(manifestName),
|
||||
compress ? "." GZIP_EXT : ""),
|
||||
compress ? "." GZ_EXT : ""),
|
||||
.compressible = true);
|
||||
|
||||
IoFilterGroup *filterGroup = ioWriteFilterGroup(storageWriteIo(write));
|
||||
@ -938,7 +938,7 @@ backupFilePut(BackupData *backupData, Manifest *manifest, const String *name, ti
|
||||
if (compress)
|
||||
{
|
||||
ioFilterGroupAdd(
|
||||
ioWriteFilterGroup(storageWriteIo(write)), gzipCompressNew((int)cfgOptionUInt(cfgOptCompressLevel), false));
|
||||
ioWriteFilterGroup(storageWriteIo(write)), gzCompressNew((int)cfgOptionUInt(cfgOptCompressLevel), false));
|
||||
}
|
||||
|
||||
// Add encryption filter if required
|
||||
@ -1652,7 +1652,7 @@ backupProcess(BackupData *backupData, Manifest *manifest, const String *lsnStart
|
||||
manifestFileRemove(manifest, strLstGet(fileRemove, fileRemoveIdx));
|
||||
|
||||
// Log references or create hardlinks for all files
|
||||
const char *const compressExt = jobData.compress ? "." GZIP_EXT : "";
|
||||
const char *const compressExt = jobData.compress ? "." GZ_EXT : "";
|
||||
|
||||
for (unsigned int fileIdx = 0; fileIdx < manifestFileTotal(manifest); fileIdx++)
|
||||
{
|
||||
@ -1758,7 +1758,7 @@ backupArchiveCheckCopy(Manifest *manifest, unsigned int walSegmentSize, const St
|
||||
if (cfgOptionBool(cfgOptArchiveCopy))
|
||||
{
|
||||
// Is the archive file compressed?
|
||||
bool archiveCompressed = strEndsWithZ(archiveFile, "." GZIP_EXT);
|
||||
bool archiveCompressed = strEndsWithZ(archiveFile, "." GZ_EXT);
|
||||
|
||||
// Open the archive file
|
||||
StorageRead *read = storageNewReadP(
|
||||
@ -1774,9 +1774,9 @@ backupArchiveCheckCopy(Manifest *manifest, unsigned int walSegmentSize, const St
|
||||
if (archiveCompressed != cfgOptionBool(cfgOptCompress))
|
||||
{
|
||||
if (archiveCompressed)
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzipDecompressNew(false));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzDecompressNew(false));
|
||||
else
|
||||
ioFilterGroupAdd(filterGroup, gzipCompressNew(cfgOptionInt(cfgOptCompressLevel), false));
|
||||
ioFilterGroupAdd(filterGroup, gzCompressNew(cfgOptionInt(cfgOptCompressLevel), false));
|
||||
}
|
||||
|
||||
// Encrypt with backup key if encrypted
|
||||
@ -1797,7 +1797,7 @@ backupArchiveCheckCopy(Manifest *manifest, unsigned int walSegmentSize, const St
|
||||
storageRepoWrite(),
|
||||
strNewFmt(
|
||||
STORAGE_REPO_BACKUP "/%s/%s%s", strPtr(manifestData(manifest)->backupLabel), strPtr(manifestName),
|
||||
cfgOptionBool(cfgOptCompress) ? "." GZIP_EXT : "")));
|
||||
cfgOptionBool(cfgOptCompress) ? "." GZ_EXT : "")));
|
||||
|
||||
// Add to manifest
|
||||
ManifestFile file =
|
||||
@ -1867,10 +1867,10 @@ backupComplete(InfoBackup *const infoBackup, Manifest *const manifest)
|
||||
StorageWrite *manifestWrite = storageNewWriteP(
|
||||
storageRepoWrite(),
|
||||
strNewFmt(
|
||||
STORAGE_REPO_BACKUP "/" BACKUP_PATH_HISTORY "/%s/%s.manifest." GZIP_EXT, strPtr(strSubN(backupLabel, 0, 4)),
|
||||
STORAGE_REPO_BACKUP "/" BACKUP_PATH_HISTORY "/%s/%s.manifest." GZ_EXT, strPtr(strSubN(backupLabel, 0, 4)),
|
||||
strPtr(backupLabel)));
|
||||
|
||||
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(manifestWrite)), gzipCompressNew(9, false));
|
||||
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(manifestWrite)), gzCompressNew(9, false));
|
||||
|
||||
cipherBlockFilterGroupAdd(
|
||||
ioWriteFilterGroup(storageWriteIo(manifestWrite)), cipherType(cfgOptionStr(cfgOptRepoCipherType)), cipherModeEncrypt,
|
||||
|
@ -7,9 +7,9 @@ Backup File
|
||||
|
||||
#include "command/backup/file.h"
|
||||
#include "command/backup/pageChecksum.h"
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/crypto/hash.h"
|
||||
#include "common/debug.h"
|
||||
@ -74,7 +74,7 @@ backupFile(
|
||||
{
|
||||
// Generate complete repo path and add compression extension if needed
|
||||
const String *repoPathFile = strNewFmt(
|
||||
STORAGE_REPO_BACKUP "/%s/%s%s", strPtr(backupLabel), strPtr(repoFile), repoFileCompress ? "." GZIP_EXT : "");
|
||||
STORAGE_REPO_BACKUP "/%s/%s%s", strPtr(backupLabel), strPtr(repoFile), repoFileCompress ? "." GZ_EXT : "");
|
||||
|
||||
// If checksum is defined then the file needs to be checked. If delta option then check the DB and possibly the repo, else
|
||||
// just check the repo.
|
||||
@ -149,7 +149,7 @@ backupFile(
|
||||
}
|
||||
|
||||
if (repoFileCompress)
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), gzipDecompressNew(false));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), gzDecompressNew(false));
|
||||
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), cryptoHashNew(HASH_TYPE_SHA1_STR));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(read), ioSizeNew());
|
||||
@ -208,7 +208,7 @@ backupFile(
|
||||
|
||||
// Add compression
|
||||
if (repoFileCompress)
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzipCompressNew((int)repoFileCompressLevel, false));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzCompressNew((int)repoFileCompressLevel, false));
|
||||
|
||||
// If there is a cipher then add the encrypt filter
|
||||
if (cipherType != cipherTypeNone)
|
||||
|
@ -8,8 +8,8 @@ Restore File
|
||||
#include <utime.h>
|
||||
|
||||
#include "command/restore/file.h"
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/crypto/hash.h"
|
||||
#include "common/debug.h"
|
||||
@ -155,7 +155,7 @@ restoreFile(
|
||||
// Add decompression filter
|
||||
if (repoFileCompressed)
|
||||
{
|
||||
ioFilterGroupAdd(filterGroup, gzipDecompressNew(false));
|
||||
ioFilterGroupAdd(filterGroup, gzDecompressNew(false));
|
||||
compressible = false;
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ restoreFile(
|
||||
storageRepo(),
|
||||
strNewFmt(
|
||||
STORAGE_REPO_BACKUP "/%s/%s%s", strPtr(repoFileReference), strPtr(repoFile),
|
||||
repoFileCompressed ? "." GZIP_EXT : ""),
|
||||
repoFileCompressed ? "." GZ_EXT : ""),
|
||||
.compressible = compressible),
|
||||
pgFileWrite);
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
/***********************************************************************************************************************************
|
||||
Gzip Common
|
||||
Gz Common
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/memContext.h"
|
||||
|
||||
@ -13,13 +13,13 @@ Gzip Common
|
||||
Constants
|
||||
***********************************************************************************************************************************/
|
||||
#define WINDOW_BITS 15
|
||||
#define WANT_GZIP 16
|
||||
#define WANT_GZ 16
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Process gzip errors
|
||||
Process gz errors
|
||||
***********************************************************************************************************************************/
|
||||
int
|
||||
gzipError(int error)
|
||||
gzError(int error)
|
||||
{
|
||||
if (error != Z_OK && error != Z_STREAM_END)
|
||||
{
|
||||
@ -91,14 +91,14 @@ gzipError(int error)
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Get gzip window bits
|
||||
Get gz window bits
|
||||
|
||||
Window bits define how large the compression window is. Larger window sizes generally result in better compression so we'll always
|
||||
use the largest size. When raw is specified disable the gzip header and produce raw compressed output (this is indicated by passing
|
||||
use the largest size. When raw is specified disable the gz header and produce raw compressed output (this is indicated by passing
|
||||
negative window bits).
|
||||
***********************************************************************************************************************************/
|
||||
int
|
||||
gzipWindowBits(bool raw)
|
||||
gzWindowBits(bool raw)
|
||||
{
|
||||
return raw ? -WINDOW_BITS : WANT_GZIP | WINDOW_BITS;
|
||||
return raw ? -WINDOW_BITS : WANT_GZ | WINDOW_BITS;
|
||||
}
|
@ -1,20 +1,20 @@
|
||||
/***********************************************************************************************************************************
|
||||
Gzip Common
|
||||
Gz Common
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMON_COMPRESS_GZIP_COMMON_H
|
||||
#define COMMON_COMPRESS_GZIP_COMMON_H
|
||||
#ifndef COMMON_COMPRESS_GZ_COMMON_H
|
||||
#define COMMON_COMPRESS_GZ_COMMON_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Gzip extension
|
||||
Gz extension
|
||||
***********************************************************************************************************************************/
|
||||
#define GZIP_EXT "gz"
|
||||
#define GZ_EXT "gz"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Functions
|
||||
***********************************************************************************************************************************/
|
||||
int gzipError(int error);
|
||||
int gzipWindowBits(bool raw);
|
||||
int gzError(int error);
|
||||
int gzWindowBits(bool raw);
|
||||
|
||||
#endif
|
@ -1,13 +1,13 @@
|
||||
/***********************************************************************************************************************************
|
||||
Gzip Compress
|
||||
Gz Compress
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/filter.intern.h"
|
||||
#include "common/log.h"
|
||||
@ -17,15 +17,15 @@ Gzip Compress
|
||||
/***********************************************************************************************************************************
|
||||
Filter type constant
|
||||
***********************************************************************************************************************************/
|
||||
STRING_EXTERN(GZIP_COMPRESS_FILTER_TYPE_STR, GZIP_COMPRESS_FILTER_TYPE);
|
||||
STRING_EXTERN(GZ_COMPRESS_FILTER_TYPE_STR, GZ_COMPRESS_FILTER_TYPE);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Object type
|
||||
***********************************************************************************************************************************/
|
||||
#define GZIP_COMPRESS_TYPE GzipCompress
|
||||
#define GZIP_COMPRESS_PREFIX gzipCompress
|
||||
#define GZ_COMPRESS_TYPE GzCompress
|
||||
#define GZ_COMPRESS_PREFIX gzCompress
|
||||
|
||||
typedef struct GzipCompress
|
||||
typedef struct GzCompress
|
||||
{
|
||||
MemContext *memContext; // Context to store data
|
||||
z_stream stream; // Compression stream state
|
||||
@ -33,23 +33,23 @@ typedef struct GzipCompress
|
||||
bool inputSame; // Is the same input required on the next process call?
|
||||
bool flush; // Is input complete and flushing in progress?
|
||||
bool done; // Is compression done?
|
||||
} GzipCompress;
|
||||
} GzCompress;
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Macros for function logging
|
||||
***********************************************************************************************************************************/
|
||||
static String *
|
||||
gzipCompressToLog(const GzipCompress *this)
|
||||
gzCompressToLog(const GzCompress *this)
|
||||
{
|
||||
return strNewFmt(
|
||||
"{inputSame: %s, done: %s, flushing: %s, availIn: %u}", cvtBoolToConstZ(this->inputSame), cvtBoolToConstZ(this->done),
|
||||
cvtBoolToConstZ(this->done), this->stream.avail_in);
|
||||
}
|
||||
|
||||
#define FUNCTION_LOG_GZIP_COMPRESS_TYPE \
|
||||
GzipCompress *
|
||||
#define FUNCTION_LOG_GZIP_COMPRESS_FORMAT(value, buffer, bufferSize) \
|
||||
FUNCTION_LOG_STRING_OBJECT_FORMAT(value, gzipCompressToLog, buffer, bufferSize)
|
||||
#define FUNCTION_LOG_GZ_COMPRESS_TYPE \
|
||||
GzCompress *
|
||||
#define FUNCTION_LOG_GZ_COMPRESS_FORMAT(value, buffer, bufferSize) \
|
||||
FUNCTION_LOG_STRING_OBJECT_FORMAT(value, gzCompressToLog, buffer, bufferSize)
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Compression constants
|
||||
@ -59,7 +59,7 @@ Compression constants
|
||||
/***********************************************************************************************************************************
|
||||
Free deflate stream
|
||||
***********************************************************************************************************************************/
|
||||
OBJECT_DEFINE_FREE_RESOURCE_BEGIN(GZIP_COMPRESS, LOG, logLevelTrace)
|
||||
OBJECT_DEFINE_FREE_RESOURCE_BEGIN(GZ_COMPRESS, LOG, logLevelTrace)
|
||||
{
|
||||
deflateEnd(&this->stream);
|
||||
}
|
||||
@ -69,12 +69,12 @@ OBJECT_DEFINE_FREE_RESOURCE_END(LOG);
|
||||
Compress data
|
||||
***********************************************************************************************************************************/
|
||||
static void
|
||||
gzipCompressProcess(THIS_VOID, const Buffer *uncompressed, Buffer *compressed)
|
||||
gzCompressProcess(THIS_VOID, const Buffer *uncompressed, Buffer *compressed)
|
||||
{
|
||||
THIS(GzipCompress);
|
||||
THIS(GzCompress);
|
||||
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(GZIP_COMPRESS, this);
|
||||
FUNCTION_LOG_PARAM(GZ_COMPRESS, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, uncompressed);
|
||||
FUNCTION_LOG_PARAM(BUFFER, compressed);
|
||||
FUNCTION_LOG_END();
|
||||
@ -107,7 +107,7 @@ gzipCompressProcess(THIS_VOID, const Buffer *uncompressed, Buffer *compressed)
|
||||
this->stream.next_out = bufPtr(compressed) + bufUsed(compressed);
|
||||
|
||||
// Perform compression
|
||||
gzipError(deflate(&this->stream, this->flush ? Z_FINISH : Z_NO_FLUSH));
|
||||
gzError(deflate(&this->stream, this->flush ? Z_FINISH : Z_NO_FLUSH));
|
||||
|
||||
// Set buffer used space
|
||||
bufUsedSet(compressed, bufSize(compressed) - (size_t)this->stream.avail_out);
|
||||
@ -126,12 +126,12 @@ gzipCompressProcess(THIS_VOID, const Buffer *uncompressed, Buffer *compressed)
|
||||
Is compress done?
|
||||
***********************************************************************************************************************************/
|
||||
static bool
|
||||
gzipCompressDone(const THIS_VOID)
|
||||
gzCompressDone(const THIS_VOID)
|
||||
{
|
||||
THIS(const GzipCompress);
|
||||
THIS(const GzCompress);
|
||||
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(GZIP_COMPRESS, this);
|
||||
FUNCTION_TEST_PARAM(GZ_COMPRESS, this);
|
||||
FUNCTION_TEST_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
@ -143,12 +143,12 @@ gzipCompressDone(const THIS_VOID)
|
||||
Is the same input required on the next process call?
|
||||
***********************************************************************************************************************************/
|
||||
static bool
|
||||
gzipCompressInputSame(const THIS_VOID)
|
||||
gzCompressInputSame(const THIS_VOID)
|
||||
{
|
||||
THIS(const GzipCompress);
|
||||
THIS(const GzCompress);
|
||||
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(GZIP_COMPRESS, this);
|
||||
FUNCTION_TEST_PARAM(GZ_COMPRESS, this);
|
||||
FUNCTION_TEST_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
@ -160,7 +160,7 @@ gzipCompressInputSame(const THIS_VOID)
|
||||
New object
|
||||
***********************************************************************************************************************************/
|
||||
IoFilter *
|
||||
gzipCompressNew(int level, bool raw)
|
||||
gzCompressNew(int level, bool raw)
|
||||
{
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(INT, level);
|
||||
@ -171,21 +171,21 @@ gzipCompressNew(int level, bool raw)
|
||||
|
||||
IoFilter *this = NULL;
|
||||
|
||||
MEM_CONTEXT_NEW_BEGIN("GzipCompress")
|
||||
MEM_CONTEXT_NEW_BEGIN("GzCompress")
|
||||
{
|
||||
GzipCompress *driver = memNew(sizeof(GzipCompress));
|
||||
GzCompress *driver = memNew(sizeof(GzCompress));
|
||||
|
||||
*driver = (GzipCompress)
|
||||
*driver = (GzCompress)
|
||||
{
|
||||
.memContext = MEM_CONTEXT_NEW(),
|
||||
.stream = {.zalloc = NULL},
|
||||
};
|
||||
|
||||
// Create gzip stream
|
||||
gzipError(deflateInit2(&driver->stream, level, Z_DEFLATED, gzipWindowBits(raw), MEM_LEVEL, Z_DEFAULT_STRATEGY));
|
||||
// Create gz stream
|
||||
gzError(deflateInit2(&driver->stream, level, Z_DEFLATED, gzWindowBits(raw), MEM_LEVEL, Z_DEFAULT_STRATEGY));
|
||||
|
||||
// Set free callback to ensure gzip context is freed
|
||||
memContextCallbackSet(driver->memContext, gzipCompressFreeResource, driver);
|
||||
// Set free callback to ensure gz context is freed
|
||||
memContextCallbackSet(driver->memContext, gzCompressFreeResource, driver);
|
||||
|
||||
// Create param list
|
||||
VariantList *paramList = varLstNew();
|
||||
@ -194,8 +194,8 @@ gzipCompressNew(int level, bool raw)
|
||||
|
||||
// Create filter interface
|
||||
this = ioFilterNewP(
|
||||
GZIP_COMPRESS_FILTER_TYPE_STR, driver, paramList, .done = gzipCompressDone, .inOut = gzipCompressProcess,
|
||||
.inputSame = gzipCompressInputSame);
|
||||
GZ_COMPRESS_FILTER_TYPE_STR, driver, paramList, .done = gzCompressDone, .inOut = gzCompressProcess,
|
||||
.inputSame = gzCompressInputSame);
|
||||
}
|
||||
MEM_CONTEXT_NEW_END();
|
||||
|
||||
@ -203,7 +203,7 @@ gzipCompressNew(int level, bool raw)
|
||||
}
|
||||
|
||||
IoFilter *
|
||||
gzipCompressNewVar(const VariantList *paramList)
|
||||
gzCompressNewVar(const VariantList *paramList)
|
||||
{
|
||||
return gzipCompressNew(varIntForce(varLstGet(paramList, 0)), varBool(varLstGet(paramList, 1)));
|
||||
return gzCompressNew(varIntForce(varLstGet(paramList, 0)), varBool(varLstGet(paramList, 1)));
|
||||
}
|
@ -1,23 +1,23 @@
|
||||
/***********************************************************************************************************************************
|
||||
Gzip Compress
|
||||
Gz Compress
|
||||
|
||||
Compress IO using the gzip format.
|
||||
Compress IO using the gz format.
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMON_COMPRESS_GZIP_COMPRESS_H
|
||||
#define COMMON_COMPRESS_GZIP_COMPRESS_H
|
||||
#ifndef COMMON_COMPRESS_GZ_COMPRESS_H
|
||||
#define COMMON_COMPRESS_GZ_COMPRESS_H
|
||||
|
||||
#include "common/io/filter/filter.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Filter type constant
|
||||
***********************************************************************************************************************************/
|
||||
#define GZIP_COMPRESS_FILTER_TYPE "gzipCompress"
|
||||
STRING_DECLARE(GZIP_COMPRESS_FILTER_TYPE_STR);
|
||||
#define GZ_COMPRESS_FILTER_TYPE "gzCompress"
|
||||
STRING_DECLARE(GZ_COMPRESS_FILTER_TYPE_STR);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Constructor
|
||||
***********************************************************************************************************************************/
|
||||
IoFilter *gzipCompressNew(int level, bool raw);
|
||||
IoFilter *gzipCompressNewVar(const VariantList *paramList);
|
||||
IoFilter *gzCompressNew(int level, bool raw);
|
||||
IoFilter *gzCompressNewVar(const VariantList *paramList);
|
||||
|
||||
#endif
|
@ -1,13 +1,13 @@
|
||||
/***********************************************************************************************************************************
|
||||
Gzip Decompress
|
||||
Gz Decompress
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#include "common/compress/gzip/common.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/filter.intern.h"
|
||||
#include "common/log.h"
|
||||
@ -17,15 +17,15 @@ Gzip Decompress
|
||||
/***********************************************************************************************************************************
|
||||
Filter type constant
|
||||
***********************************************************************************************************************************/
|
||||
STRING_EXTERN(GZIP_DECOMPRESS_FILTER_TYPE_STR, GZIP_DECOMPRESS_FILTER_TYPE);
|
||||
STRING_EXTERN(GZ_DECOMPRESS_FILTER_TYPE_STR, GZ_DECOMPRESS_FILTER_TYPE);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Object type
|
||||
***********************************************************************************************************************************/
|
||||
#define GZIP_DECOMPRESS_TYPE GzipDecompress
|
||||
#define GZIP_DECOMPRESS_PREFIX gzipDecompress
|
||||
#define GZ_DECOMPRESS_TYPE GzDecompress
|
||||
#define GZ_DECOMPRESS_PREFIX gzDecompress
|
||||
|
||||
typedef struct GzipDecompress
|
||||
typedef struct GzDecompress
|
||||
{
|
||||
MemContext *memContext; // Context to store data
|
||||
z_stream stream; // Decompression stream state
|
||||
@ -33,28 +33,28 @@ typedef struct GzipDecompress
|
||||
int result; // Result of last operation
|
||||
bool inputSame; // Is the same input required on the next process call?
|
||||
bool done; // Is decompression done?
|
||||
} GzipDecompress;
|
||||
} GzDecompress;
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Macros for function logging
|
||||
***********************************************************************************************************************************/
|
||||
String *
|
||||
gzipDecompressToLog(const GzipDecompress *this)
|
||||
gzDecompressToLog(const GzDecompress *this)
|
||||
{
|
||||
return strNewFmt(
|
||||
"{inputSame: %s, done: %s, availIn: %u}", cvtBoolToConstZ(this->inputSame), cvtBoolToConstZ(this->done),
|
||||
this->stream.avail_in);
|
||||
}
|
||||
|
||||
#define FUNCTION_LOG_GZIP_DECOMPRESS_TYPE \
|
||||
GzipDecompress *
|
||||
#define FUNCTION_LOG_GZIP_DECOMPRESS_FORMAT(value, buffer, bufferSize) \
|
||||
FUNCTION_LOG_STRING_OBJECT_FORMAT(value, gzipDecompressToLog, buffer, bufferSize)
|
||||
#define FUNCTION_LOG_GZ_DECOMPRESS_TYPE \
|
||||
GzDecompress *
|
||||
#define FUNCTION_LOG_GZ_DECOMPRESS_FORMAT(value, buffer, bufferSize) \
|
||||
FUNCTION_LOG_STRING_OBJECT_FORMAT(value, gzDecompressToLog, buffer, bufferSize)
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Free inflate stream
|
||||
***********************************************************************************************************************************/
|
||||
OBJECT_DEFINE_FREE_RESOURCE_BEGIN(GZIP_DECOMPRESS, LOG, logLevelTrace)
|
||||
OBJECT_DEFINE_FREE_RESOURCE_BEGIN(GZ_DECOMPRESS, LOG, logLevelTrace)
|
||||
{
|
||||
inflateEnd(&this->stream);
|
||||
}
|
||||
@ -64,12 +64,12 @@ OBJECT_DEFINE_FREE_RESOURCE_END(LOG);
|
||||
Decompress data
|
||||
***********************************************************************************************************************************/
|
||||
void
|
||||
gzipDecompressProcess(THIS_VOID, const Buffer *compressed, Buffer *uncompressed)
|
||||
gzDecompressProcess(THIS_VOID, const Buffer *compressed, Buffer *uncompressed)
|
||||
{
|
||||
THIS(GzipDecompress);
|
||||
THIS(GzDecompress);
|
||||
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(GZIP_DECOMPRESS, this);
|
||||
FUNCTION_LOG_PARAM(GZ_DECOMPRESS, this);
|
||||
FUNCTION_LOG_PARAM(BUFFER, compressed);
|
||||
FUNCTION_LOG_PARAM(BUFFER, uncompressed);
|
||||
FUNCTION_LOG_END();
|
||||
@ -91,7 +91,7 @@ gzipDecompressProcess(THIS_VOID, const Buffer *compressed, Buffer *uncompressed)
|
||||
this->stream.avail_out = (unsigned int)bufRemains(uncompressed);
|
||||
this->stream.next_out = bufPtr(uncompressed) + bufUsed(uncompressed);
|
||||
|
||||
this->result = gzipError(inflate(&this->stream, Z_NO_FLUSH));
|
||||
this->result = gzError(inflate(&this->stream, Z_NO_FLUSH));
|
||||
|
||||
// Set buffer used space
|
||||
bufUsedSet(uncompressed, bufSize(uncompressed) - (size_t)this->stream.avail_out);
|
||||
@ -109,12 +109,12 @@ gzipDecompressProcess(THIS_VOID, const Buffer *compressed, Buffer *uncompressed)
|
||||
Is decompress done?
|
||||
***********************************************************************************************************************************/
|
||||
bool
|
||||
gzipDecompressDone(const THIS_VOID)
|
||||
gzDecompressDone(const THIS_VOID)
|
||||
{
|
||||
THIS(const GzipDecompress);
|
||||
THIS(const GzDecompress);
|
||||
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(GZIP_DECOMPRESS, this);
|
||||
FUNCTION_TEST_PARAM(GZ_DECOMPRESS, this);
|
||||
FUNCTION_TEST_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
@ -126,12 +126,12 @@ gzipDecompressDone(const THIS_VOID)
|
||||
Is the same input required on the next process call?
|
||||
***********************************************************************************************************************************/
|
||||
bool
|
||||
gzipDecompressInputSame(const THIS_VOID)
|
||||
gzDecompressInputSame(const THIS_VOID)
|
||||
{
|
||||
THIS(const GzipDecompress);
|
||||
THIS(const GzDecompress);
|
||||
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(GZIP_DECOMPRESS, this);
|
||||
FUNCTION_TEST_PARAM(GZ_DECOMPRESS, this);
|
||||
FUNCTION_TEST_END();
|
||||
|
||||
ASSERT(this != NULL);
|
||||
@ -143,7 +143,7 @@ gzipDecompressInputSame(const THIS_VOID)
|
||||
New object
|
||||
***********************************************************************************************************************************/
|
||||
IoFilter *
|
||||
gzipDecompressNew(bool raw)
|
||||
gzDecompressNew(bool raw)
|
||||
{
|
||||
FUNCTION_LOG_BEGIN(logLevelTrace);
|
||||
FUNCTION_LOG_PARAM(BOOL, raw);
|
||||
@ -151,22 +151,22 @@ gzipDecompressNew(bool raw)
|
||||
|
||||
IoFilter *this = NULL;
|
||||
|
||||
MEM_CONTEXT_NEW_BEGIN("GzipDecompress")
|
||||
MEM_CONTEXT_NEW_BEGIN("GzDecompress")
|
||||
{
|
||||
// Allocate state and set context
|
||||
GzipDecompress *driver = memNew(sizeof(GzipDecompress));
|
||||
GzDecompress *driver = memNew(sizeof(GzDecompress));
|
||||
|
||||
*driver = (GzipDecompress)
|
||||
*driver = (GzDecompress)
|
||||
{
|
||||
.memContext = MEM_CONTEXT_NEW(),
|
||||
.stream = {.zalloc = NULL},
|
||||
};
|
||||
|
||||
// Create gzip stream
|
||||
gzipError(driver->result = inflateInit2(&driver->stream, gzipWindowBits(raw)));
|
||||
// Create gz stream
|
||||
gzError(driver->result = inflateInit2(&driver->stream, gzWindowBits(raw)));
|
||||
|
||||
// Set free callback to ensure gzip context is freed
|
||||
memContextCallbackSet(driver->memContext, gzipDecompressFreeResource, driver);
|
||||
// Set free callback to ensure gz context is freed
|
||||
memContextCallbackSet(driver->memContext, gzDecompressFreeResource, driver);
|
||||
|
||||
// Create param list
|
||||
VariantList *paramList = varLstNew();
|
||||
@ -174,8 +174,8 @@ gzipDecompressNew(bool raw)
|
||||
|
||||
// Create filter interface
|
||||
this = ioFilterNewP(
|
||||
GZIP_DECOMPRESS_FILTER_TYPE_STR, driver, paramList, .done = gzipDecompressDone, .inOut = gzipDecompressProcess,
|
||||
.inputSame = gzipDecompressInputSame);
|
||||
GZ_DECOMPRESS_FILTER_TYPE_STR, driver, paramList, .done = gzDecompressDone, .inOut = gzDecompressProcess,
|
||||
.inputSame = gzDecompressInputSame);
|
||||
}
|
||||
MEM_CONTEXT_NEW_END();
|
||||
|
||||
@ -183,7 +183,7 @@ gzipDecompressNew(bool raw)
|
||||
}
|
||||
|
||||
IoFilter *
|
||||
gzipDecompressNewVar(const VariantList *paramList)
|
||||
gzDecompressNewVar(const VariantList *paramList)
|
||||
{
|
||||
return gzipDecompressNew(varBool(varLstGet(paramList, 0)));
|
||||
return gzDecompressNew(varBool(varLstGet(paramList, 0)));
|
||||
}
|
@ -1,23 +1,23 @@
|
||||
/***********************************************************************************************************************************
|
||||
Gzip Decompress
|
||||
Gz Decompress
|
||||
|
||||
Decompress IO from the gzip format.
|
||||
Decompress IO from the gz format.
|
||||
***********************************************************************************************************************************/
|
||||
#ifndef COMMON_COMPRESS_GZIP_DECOMPRESS_H
|
||||
#define COMMON_COMPRESS_GZIP_DECOMPRESS_H
|
||||
#ifndef COMMON_COMPRESS_GZ_DECOMPRESS_H
|
||||
#define COMMON_COMPRESS_GZ_DECOMPRESS_H
|
||||
|
||||
#include "common/io/filter/filter.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Filter type constant
|
||||
***********************************************************************************************************************************/
|
||||
#define GZIP_DECOMPRESS_FILTER_TYPE "gzipDecompress"
|
||||
STRING_DECLARE(GZIP_DECOMPRESS_FILTER_TYPE_STR);
|
||||
#define GZ_DECOMPRESS_FILTER_TYPE "gzDecompress"
|
||||
STRING_DECLARE(GZ_DECOMPRESS_FILTER_TYPE_STR);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Constructor
|
||||
***********************************************************************************************************************************/
|
||||
IoFilter *gzipDecompressNew(bool raw);
|
||||
IoFilter *gzipDecompressNewVar(const VariantList *paramList);
|
||||
IoFilter *gzDecompressNew(bool raw);
|
||||
IoFilter *gzDecompressNewVar(const VariantList *paramList);
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
/***********************************************************************************************************************************
|
||||
IO Filter Interface
|
||||
|
||||
Filters can modify an i/o stream (e.g. GzipCompress, GzipDecompress), generate a result (e.g. IoSize, CryptoHash), or even do both.
|
||||
Filters can modify an i/o stream (e.g. GzCompress, GzDecompress), generate a result (e.g. IoSize, CryptoHash), or even do both.
|
||||
|
||||
A filter is created using a constructor implemented by each filter (e.g. ioBufferNew). Filter processing is managed by
|
||||
IoFilterGroup so the only user facing functions are ioFilterResult() and ioFilterType().
|
||||
|
2
src/configure
vendored
2
src/configure
vendored
@ -3660,7 +3660,7 @@ fi
|
||||
CLIBRARY="$CLIBRARY `pkg-config libxml-2.0 --cflags`"
|
||||
|
||||
|
||||
# Check required gzip library
|
||||
# Check required gz library
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
|
||||
$as_echo_n "checking for deflate in -lz... " >&6; }
|
||||
if ${ac_cv_lib_z_deflate+:} false; then :
|
||||
|
@ -54,7 +54,7 @@ AC_CHECK_LIB([xml2], [xmlSaveToBuffer], [], [AC_MSG_ERROR([library 'xml2' is req
|
||||
AC_CHECK_HEADER(libxml/parser.h, [], [AC_MSG_ERROR([header file <libxml/parser.h> is required])])
|
||||
AC_SUBST(CLIBRARY, "$CLIBRARY `pkg-config libxml-2.0 --cflags`")
|
||||
|
||||
# Check required gzip library
|
||||
# Check required gz library
|
||||
AC_CHECK_LIB([z], [deflate], [], [AC_MSG_ERROR([library 'z' is required])])
|
||||
|
||||
# Write output
|
||||
|
@ -4,8 +4,8 @@ Remote Storage Protocol Handler
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "command/backup/pageChecksum.h"
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/crypto/hash.h"
|
||||
#include "common/debug.h"
|
||||
@ -72,10 +72,10 @@ storageRemoteFilterGroup(IoFilterGroup *filterGroup, const Variant *filterList)
|
||||
const String *filterKey = varStr(varLstGet(kvKeyList(filterKv), 0));
|
||||
const VariantList *filterParam = varVarLst(kvGet(filterKv, VARSTR(filterKey)));
|
||||
|
||||
if (strEq(filterKey, GZIP_COMPRESS_FILTER_TYPE_STR))
|
||||
ioFilterGroupAdd(filterGroup, gzipCompressNewVar(filterParam));
|
||||
else if (strEq(filterKey, GZIP_DECOMPRESS_FILTER_TYPE_STR))
|
||||
ioFilterGroupAdd(filterGroup, gzipDecompressNewVar(filterParam));
|
||||
if (strEq(filterKey, GZ_COMPRESS_FILTER_TYPE_STR))
|
||||
ioFilterGroupAdd(filterGroup, gzCompressNewVar(filterParam));
|
||||
else if (strEq(filterKey, GZ_DECOMPRESS_FILTER_TYPE_STR))
|
||||
ioFilterGroupAdd(filterGroup, gzDecompressNewVar(filterParam));
|
||||
else if (strEq(filterKey, CIPHER_BLOCK_FILTER_TYPE_STR))
|
||||
ioFilterGroupAdd(filterGroup, cipherBlockNewVar(filterParam));
|
||||
else if (strEq(filterKey, CRYPTO_HASH_FILTER_TYPE_STR))
|
||||
|
@ -6,8 +6,8 @@ Remote Storage Read
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/read.intern.h"
|
||||
#include "common/log.h"
|
||||
@ -67,7 +67,7 @@ storageReadRemoteOpen(THIS_VOID)
|
||||
if (this->interface.compressible)
|
||||
{
|
||||
ioFilterGroupAdd(
|
||||
ioReadFilterGroup(storageReadIo(this->read)), gzipCompressNew((int)this->interface.compressLevel, true));
|
||||
ioReadFilterGroup(storageReadIo(this->read)), gzCompressNew((int)this->interface.compressLevel, true));
|
||||
}
|
||||
|
||||
ProtocolCommand *command = protocolCommandNew(PROTOCOL_COMMAND_STORAGE_OPEN_READ_STR);
|
||||
@ -82,7 +82,7 @@ storageReadRemoteOpen(THIS_VOID)
|
||||
|
||||
// If the file is compressible add decompression filter locally
|
||||
if (this->interface.compressible)
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(this->read)), gzipDecompressNew(true));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(this->read)), gzDecompressNew(true));
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
|
@ -3,8 +3,8 @@ Remote Storage File write
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/write.intern.h"
|
||||
#include "common/log.h"
|
||||
@ -70,7 +70,7 @@ storageWriteRemoteOpen(THIS_VOID)
|
||||
{
|
||||
// If the file is compressible add decompression filter on the remote
|
||||
if (this->interface.compressible)
|
||||
ioFilterGroupInsert(ioWriteFilterGroup(storageWriteIo(this->write)), 0, gzipDecompressNew(true));
|
||||
ioFilterGroupInsert(ioWriteFilterGroup(storageWriteIo(this->write)), 0, gzDecompressNew(true));
|
||||
|
||||
ProtocolCommand *command = protocolCommandNew(PROTOCOL_COMMAND_STORAGE_OPEN_WRITE_STR);
|
||||
protocolCommandParamAdd(command, VARSTR(this->interface.name));
|
||||
@ -94,7 +94,7 @@ storageWriteRemoteOpen(THIS_VOID)
|
||||
if (this->interface.compressible)
|
||||
{
|
||||
ioFilterGroupAdd(
|
||||
ioWriteFilterGroup(storageWriteIo(this->write)), gzipCompressNew((int)this->interface.compressLevel, true));
|
||||
ioWriteFilterGroup(storageWriteIo(this->write)), gzCompressNew((int)this->interface.compressLevel, true));
|
||||
}
|
||||
|
||||
// Set free callback to ensure remote file is freed
|
||||
|
@ -615,27 +615,27 @@ src/common/assert.h:
|
||||
class: core
|
||||
type: c/h
|
||||
|
||||
src/common/compress/gzip/common.c:
|
||||
src/common/compress/gz/common.c:
|
||||
class: core
|
||||
type: c
|
||||
|
||||
src/common/compress/gzip/common.h:
|
||||
src/common/compress/gz/common.h:
|
||||
class: core
|
||||
type: c/h
|
||||
|
||||
src/common/compress/gzip/compress.c:
|
||||
src/common/compress/gz/compress.c:
|
||||
class: core
|
||||
type: c
|
||||
|
||||
src/common/compress/gzip/compress.h:
|
||||
src/common/compress/gz/compress.h:
|
||||
class: core
|
||||
type: c/h
|
||||
|
||||
src/common/compress/gzip/decompress.c:
|
||||
src/common/compress/gz/decompress.c:
|
||||
class: core
|
||||
type: c
|
||||
|
||||
src/common/compress/gzip/decompress.h:
|
||||
src/common/compress/gz/decompress.h:
|
||||
class: core
|
||||
type: c/h
|
||||
|
||||
@ -1779,7 +1779,7 @@ test/src/module/common/assertOnTest.c:
|
||||
class: test/module
|
||||
type: c
|
||||
|
||||
test/src/module/common/compressGzipTest.c:
|
||||
test/src/module/common/compressTest.c:
|
||||
class: test/module
|
||||
type: c
|
||||
|
||||
|
@ -257,13 +257,13 @@ unit:
|
||||
common/io/http/query: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: compress-gzip
|
||||
- name: compress
|
||||
total: 4
|
||||
|
||||
coverage:
|
||||
common/compress/gzip/common: full
|
||||
common/compress/gzip/compress: full
|
||||
common/compress/gzip/decompress: full
|
||||
common/compress/gz/common: full
|
||||
common/compress/gz/compress: full
|
||||
common/compress/gz/decompress: full
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------------
|
||||
- name: crypto
|
||||
|
@ -4,7 +4,7 @@ Storage Test Harness
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/compress/gzip/decompress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/user.h"
|
||||
#include "storage/storage.h"
|
||||
|
||||
@ -39,7 +39,7 @@ hrnStorageInfoListCallback(void *callbackData, const StorageInfo *info)
|
||||
StorageRead *read = storageNewReadP(
|
||||
data->storage,
|
||||
data->path != NULL ? strNewFmt("%s/%s", strPtr(data->path), strPtr(info->name)) : info->name);
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzipDecompressNew(false));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzDecompressNew(false));
|
||||
size = bufUsed(storageGetP(read));
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/***********************************************************************************************************************************
|
||||
Test Archive Get Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/harnessConfig.h"
|
||||
#include "common/harnessFork.h"
|
||||
#include "common/io/bufferRead.h"
|
||||
@ -202,7 +202,7 @@ testRun(void)
|
||||
"repo/archive/test1/10-1/01ABCDEF01ABCDEF/01ABCDEF01ABCDEF01ABCDEF-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz"));
|
||||
|
||||
IoFilterGroup *filterGroup = ioWriteFilterGroup(storageWriteIo(destination));
|
||||
ioFilterGroupAdd(filterGroup, gzipCompressNew(3, false));
|
||||
ioFilterGroupAdd(filterGroup, gzCompressNew(3, false));
|
||||
ioFilterGroupAdd(
|
||||
filterGroup, cipherBlockNew(cipherModeEncrypt, cipherTypeAes256Cbc, BUFSTRDEF("worstpassphraseever"), NULL));
|
||||
storagePutP(destination, buffer);
|
||||
|
@ -70,17 +70,17 @@ testBackupValidateCallback(void *callbackData, const StorageInfo *info)
|
||||
const String *manifestName = info->name;
|
||||
|
||||
// If the file is compressed then decompress to get the real size
|
||||
if (strEndsWithZ(info->name, "." GZIP_EXT))
|
||||
if (strEndsWithZ(info->name, "." GZ_EXT))
|
||||
{
|
||||
ASSERT(data->storage != NULL);
|
||||
|
||||
StorageRead *read = storageNewReadP(
|
||||
data->storage,
|
||||
data->path != NULL ? strNewFmt("%s/%s", strPtr(data->path), strPtr(info->name)) : info->name);
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzipDecompressNew(false));
|
||||
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzDecompressNew(false));
|
||||
size = bufUsed(storageGetP(read));
|
||||
|
||||
manifestName = strSubN(info->name, 0, strSize(info->name) - strlen("." GZIP_EXT));
|
||||
manifestName = strSubN(info->name, 0, strSize(info->name) - strlen("." GZ_EXT));
|
||||
}
|
||||
|
||||
strCatFmt(data->content, ", s=%" PRIu64, size);
|
||||
@ -241,10 +241,10 @@ testBackupPqScript(unsigned int pgVersion, time_t backupTimeStart, TestBackupPqS
|
||||
storageRepoWrite(),
|
||||
strNewFmt(
|
||||
STORAGE_REPO_ARCHIVE "/%s/%s-%s%s", strPtr(archiveId), strPtr(strLstGet(walSegmentList, walSegmentIdx)),
|
||||
strPtr(walChecksum), param.walCompress ? "." GZIP_EXT : ""));
|
||||
strPtr(walChecksum), param.walCompress ? "." GZ_EXT : ""));
|
||||
|
||||
if (param.walCompress)
|
||||
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(write)), gzipCompressNew(1, false));
|
||||
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(write)), gzCompressNew(1, false));
|
||||
|
||||
storagePutP(write, walBuffer);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/***********************************************************************************************************************************
|
||||
Test Restore Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/compress/gzip/compress.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/io/bufferRead.h"
|
||||
@ -196,7 +196,7 @@ testRun(void)
|
||||
StorageWrite *ceRepoFile = storageNewWriteP(
|
||||
storageRepoWrite(), strNewFmt(STORAGE_REPO_BACKUP "/%s/%s.gz", strPtr(repoFileReferenceFull), strPtr(repoFile1)));
|
||||
IoFilterGroup *filterGroup = ioWriteFilterGroup(storageWriteIo(ceRepoFile));
|
||||
ioFilterGroupAdd(filterGroup, gzipCompressNew(3, false));
|
||||
ioFilterGroupAdd(filterGroup, gzCompressNew(3, false));
|
||||
ioFilterGroupAdd(filterGroup, cipherBlockNew(cipherModeEncrypt, cipherTypeAes256Cbc, BUFSTRDEF("badpass"), NULL));
|
||||
|
||||
storagePutP(ceRepoFile, BUFSTRDEF("acefile"));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/***********************************************************************************************************************************
|
||||
Test Gzip
|
||||
Test Compression
|
||||
***********************************************************************************************************************************/
|
||||
#include "common/io/filter/group.h"
|
||||
#include "common/io/bufferRead.h"
|
||||
@ -35,7 +35,7 @@ testCompress(IoFilter *compress, Buffer *decompressed, size_t inputSize, size_t
|
||||
}
|
||||
|
||||
ioWriteClose(write);
|
||||
memContextFree(((GzipCompress *)ioFilterDriver(compress))->memContext);
|
||||
memContextFree(((GzCompress *)ioFilterDriver(compress))->memContext);
|
||||
|
||||
return compressed;
|
||||
}
|
||||
@ -63,7 +63,7 @@ testDecompress(IoFilter *decompress, Buffer *compressed, size_t inputSize, size_
|
||||
|
||||
ioReadClose(read);
|
||||
bufFree(output);
|
||||
memContextFree(((GzipDecompress *)ioFilterDriver(decompress))->memContext);
|
||||
memContextFree(((GzDecompress *)ioFilterDriver(decompress))->memContext);
|
||||
|
||||
return decompressed;
|
||||
}
|
||||
@ -77,30 +77,30 @@ testRun(void)
|
||||
FUNCTION_HARNESS_VOID();
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("gzipError"))
|
||||
if (testBegin("gzError"))
|
||||
{
|
||||
TEST_RESULT_INT(gzipError(Z_OK), Z_OK, "check ok");
|
||||
TEST_RESULT_INT(gzipError(Z_STREAM_END), Z_STREAM_END, "check stream end");
|
||||
TEST_ERROR(gzipError(Z_NEED_DICT), AssertError, "zlib threw error: [2] need dictionary");
|
||||
TEST_ERROR(gzipError(Z_ERRNO), AssertError, "zlib threw error: [-1] file error");
|
||||
TEST_ERROR(gzipError(Z_STREAM_ERROR), FormatError, "zlib threw error: [-2] stream error");
|
||||
TEST_ERROR(gzipError(Z_DATA_ERROR), FormatError, "zlib threw error: [-3] data error");
|
||||
TEST_ERROR(gzipError(Z_MEM_ERROR), MemoryError, "zlib threw error: [-4] insufficient memory");
|
||||
TEST_ERROR(gzipError(Z_BUF_ERROR), AssertError, "zlib threw error: [-5] no space in buffer");
|
||||
TEST_ERROR(gzipError(Z_VERSION_ERROR), FormatError, "zlib threw error: [-6] incompatible version");
|
||||
TEST_ERROR(gzipError(999), AssertError, "zlib threw error: [999] unknown error");
|
||||
TEST_RESULT_INT(gzError(Z_OK), Z_OK, "check ok");
|
||||
TEST_RESULT_INT(gzError(Z_STREAM_END), Z_STREAM_END, "check stream end");
|
||||
TEST_ERROR(gzError(Z_NEED_DICT), AssertError, "zlib threw error: [2] need dictionary");
|
||||
TEST_ERROR(gzError(Z_ERRNO), AssertError, "zlib threw error: [-1] file error");
|
||||
TEST_ERROR(gzError(Z_STREAM_ERROR), FormatError, "zlib threw error: [-2] stream error");
|
||||
TEST_ERROR(gzError(Z_DATA_ERROR), FormatError, "zlib threw error: [-3] data error");
|
||||
TEST_ERROR(gzError(Z_MEM_ERROR), MemoryError, "zlib threw error: [-4] insufficient memory");
|
||||
TEST_ERROR(gzError(Z_BUF_ERROR), AssertError, "zlib threw error: [-5] no space in buffer");
|
||||
TEST_ERROR(gzError(Z_VERSION_ERROR), FormatError, "zlib threw error: [-6] incompatible version");
|
||||
TEST_ERROR(gzError(999), AssertError, "zlib threw error: [999] unknown error");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("gzipWindowBits"))
|
||||
if (testBegin("gzWindowBits"))
|
||||
{
|
||||
|
||||
TEST_RESULT_INT(gzipWindowBits(true), -15, "raw window bits");
|
||||
TEST_RESULT_INT(gzipWindowBits(false), 31, "gzip window bits");
|
||||
TEST_RESULT_INT(gzWindowBits(true), -15, "raw window bits");
|
||||
TEST_RESULT_INT(gzWindowBits(false), 31, "gz window bits");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("GzipCompress and GzipDecompress"))
|
||||
if (testBegin("GzCompress and GzDecompress"))
|
||||
{
|
||||
const char *simpleData = "A simple string";
|
||||
Buffer *compressed = NULL;
|
||||
@ -114,41 +114,41 @@ testRun(void)
|
||||
varLstAdd(decompressParamList, varNewBool(false));
|
||||
|
||||
TEST_ASSIGN(
|
||||
compressed, testCompress(gzipCompressNewVar(compressParamList), decompressed, 1024, 1024),
|
||||
compressed, testCompress(gzCompressNewVar(compressParamList), decompressed, 1024, 1024),
|
||||
"simple data - compress large in/large out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(compressed, testCompress(gzipCompressNew(3, false), decompressed, 1024, 1)), true,
|
||||
bufEq(compressed, testCompress(gzCompressNew(3, false), decompressed, 1024, 1)), true,
|
||||
"simple data - compress large in/small out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(compressed, testCompress(gzipCompressNew(3, false), decompressed, 1, 1024)), true,
|
||||
bufEq(compressed, testCompress(gzCompressNew(3, false), decompressed, 1, 1024)), true,
|
||||
"simple data - compress small in/large out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(compressed, testCompress(gzipCompressNew(3, false), decompressed, 1, 1)), true,
|
||||
bufEq(compressed, testCompress(gzCompressNew(3, false), decompressed, 1, 1)), true,
|
||||
"simple data - compress small in/small out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(decompressed, testDecompress(gzipDecompressNewVar(decompressParamList), compressed, 1024, 1024)), true,
|
||||
bufEq(decompressed, testDecompress(gzDecompressNewVar(decompressParamList), compressed, 1024, 1024)), true,
|
||||
"simple data - decompress large in/large out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(decompressed, testDecompress(gzipDecompressNew(false), compressed, 1024, 1)), true,
|
||||
bufEq(decompressed, testDecompress(gzDecompressNew(false), compressed, 1024, 1)), true,
|
||||
"simple data - decompress large in/small out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(decompressed, testDecompress(gzipDecompressNew(false), compressed, 1, 1024)), true,
|
||||
bufEq(decompressed, testDecompress(gzDecompressNew(false), compressed, 1, 1024)), true,
|
||||
"simple data - decompress small in/large out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(decompressed, testDecompress(gzipDecompressNew(false), compressed, 1, 1)), true,
|
||||
bufEq(decompressed, testDecompress(gzDecompressNew(false), compressed, 1, 1)), true,
|
||||
"simple data - decompress small in/small out buffer");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("error on no compression data");
|
||||
|
||||
TEST_ERROR(testDecompress(gzipDecompressNew(true), bufNew(0), 1, 1), FormatError, "unexpected eof in compressed data");
|
||||
TEST_ERROR(testDecompress(gzDecompressNew(true), bufNew(0), 1, 1), FormatError, "unexpected eof in compressed data");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
TEST_TITLE("error on truncated compression data");
|
||||
@ -157,7 +157,7 @@ testRun(void)
|
||||
bufCatSub(truncated, compressed, 0, bufUsed(compressed) - 1);
|
||||
|
||||
TEST_RESULT_UINT(bufUsed(truncated), bufUsed(compressed) - 1, "check truncated buffer size");
|
||||
TEST_ERROR(testDecompress(gzipDecompressNew(false), truncated, 512, 512), FormatError, "unexpected eof in compressed data");
|
||||
TEST_ERROR(testDecompress(gzDecompressNew(false), truncated, 512, 512), FormatError, "unexpected eof in compressed data");
|
||||
|
||||
// Compress a large zero input buffer into small output buffer
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
@ -166,24 +166,24 @@ testRun(void)
|
||||
bufUsedSet(decompressed, bufSize(decompressed));
|
||||
|
||||
TEST_ASSIGN(
|
||||
compressed, testCompress(gzipCompressNew(3, true), decompressed, bufSize(decompressed), 1024),
|
||||
compressed, testCompress(gzCompressNew(3, true), decompressed, bufSize(decompressed), 1024),
|
||||
"zero data - compress large in/small out buffer");
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
bufEq(decompressed, testDecompress(gzipDecompressNew(true), compressed, bufSize(compressed), 1024 * 256)), true,
|
||||
bufEq(decompressed, testDecompress(gzDecompressNew(true), compressed, bufSize(compressed), 1024 * 256)), true,
|
||||
"zero data - decompress large in/small out buffer");
|
||||
}
|
||||
|
||||
// *****************************************************************************************************************************
|
||||
if (testBegin("gzipDecompressToLog() and gzipCompressToLog()"))
|
||||
if (testBegin("gzDecompressToLog() and gzCompressToLog()"))
|
||||
{
|
||||
GzipDecompress *decompress = (GzipDecompress *)ioFilterDriver(gzipDecompressNew(false));
|
||||
GzDecompress *decompress = (GzDecompress *)ioFilterDriver(gzDecompressNew(false));
|
||||
|
||||
TEST_RESULT_STR_Z(gzipDecompressToLog(decompress), "{inputSame: false, done: false, availIn: 0}", "format object");
|
||||
TEST_RESULT_STR_Z(gzDecompressToLog(decompress), "{inputSame: false, done: false, availIn: 0}", "format object");
|
||||
|
||||
decompress->inputSame = true;
|
||||
decompress->done = true;
|
||||
TEST_RESULT_STR_Z(gzipDecompressToLog(decompress), "{inputSame: true, done: true, availIn: 0}", "format object");
|
||||
TEST_RESULT_STR_Z(gzDecompressToLog(decompress), "{inputSame: true, done: true, availIn: 0}", "format object");
|
||||
}
|
||||
|
||||
FUNCTION_HARNESS_RESULT_VOID();
|
@ -447,8 +447,8 @@ testRun(void)
|
||||
ioFilterGroupAdd(filterGroup, pageChecksumNew(0, PG_SEGMENT_PAGE_DEFAULT, PG_PAGE_SIZE_DEFAULT, 0));
|
||||
ioFilterGroupAdd(filterGroup, cipherBlockNew(cipherModeEncrypt, cipherTypeAes256Cbc, BUFSTRZ("x"), NULL));
|
||||
ioFilterGroupAdd(filterGroup, cipherBlockNew(cipherModeDecrypt, cipherTypeAes256Cbc, BUFSTRZ("x"), NULL));
|
||||
ioFilterGroupAdd(filterGroup, gzipCompressNew(3, false));
|
||||
ioFilterGroupAdd(filterGroup, gzipDecompressNew(false));
|
||||
ioFilterGroupAdd(filterGroup, gzCompressNew(3, false));
|
||||
ioFilterGroupAdd(filterGroup, gzDecompressNew(false));
|
||||
varLstAdd(paramList, ioFilterGroupParamAll(filterGroup));
|
||||
|
||||
TEST_RESULT_BOOL(
|
||||
@ -459,7 +459,7 @@ testRun(void)
|
||||
"BRBLOCK4\n"
|
||||
"TESTBRBLOCK4\n"
|
||||
"DATABRBLOCK0\n"
|
||||
"{\"out\":{\"buffer\":null,\"cipherBlock\":null,\"gzipCompress\":null,\"gzipDecompress\":null"
|
||||
"{\"out\":{\"buffer\":null,\"cipherBlock\":null,\"gzCompress\":null,\"gzDecompress\":null"
|
||||
",\"hash\":\"bbbcf2c59433f68f22376cd2439d6cd309378df6\",\"pageChecksum\":{\"align\":false,\"valid\":false}"
|
||||
",\"size\":8}}\n",
|
||||
"check result");
|
||||
|
Reference in New Issue
Block a user