1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-30 19:23:04 +03:00

Fix formatting errors.

Errors in our current (manually-maintained) code format discovered by uncrustify.
This commit is contained in:
David Steele
2023-01-30 11:16:31 +07:00
parent a96837d2ed
commit b2202c36d9
144 changed files with 1033 additions and 935 deletions

View File

@ -165,7 +165,6 @@ yamlEventPeek(Yaml *const this)
FUNCTION_TEST_RETURN_TYPE(YamlEvent, this->eventNext); FUNCTION_TEST_RETURN_TYPE(YamlEvent, this->eventNext);
} }
YamlEvent YamlEvent
yamlEventNext(Yaml *this) yamlEventNext(Yaml *this)
{ {

View File

@ -12,8 +12,8 @@ Yaml object
typedef struct Yaml Yaml; typedef struct Yaml Yaml;
#include "common/memContext.h" #include "common/memContext.h"
#include "common/type/object.h"
#include "common/type/buffer.h" #include "common/type/buffer.h"
#include "common/type/object.h"
#include "common/type/stringId.h" #include "common/type/stringId.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -10,12 +10,12 @@ Annotate Command
#include "command/annotate/annotate.h" #include "command/annotate/annotate.h"
#include "command/backup/backup.h" #include "command/backup/backup.h"
#include "common/crypto/cipherBlock.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h" #include "common/log.h"
#include "common/memContext.h" #include "common/memContext.h"
#include "common/regExp.h" #include "common/regExp.h"
#include "config/config.h" #include "config/config.h"
#include "common/crypto/cipherBlock.h"
#include "info/infoBackup.h" #include "info/infoBackup.h"
#include "storage/helper.h" #include "storage/helper.h"

View File

@ -301,7 +301,7 @@ archiveIdComparator(const void *item1, const void *item2)
int int1 = atoi(strZ(strLstGet(archiveSort1, 1))); int int1 = atoi(strZ(strLstGet(archiveSort1, 1)));
int int2 = atoi(strZ(strLstGet(archiveSort2, 1))); int int2 = atoi(strZ(strLstGet(archiveSort2, 1)));
return (int1 - int2); return int1 - int2;
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -3,8 +3,8 @@ Archive Get File
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include "command/archive/get/file.h"
#include "command/archive/common.h" #include "command/archive/common.h"
#include "command/archive/get/file.h"
#include "command/control/common.h" #include "command/control/common.h"
#include "common/compress/helper.h" #include "common/compress/helper.h"
#include "common/crypto/cipherBlock.h" #include "common/crypto/cipherBlock.h"

View File

@ -218,9 +218,10 @@ archiveGetFind(
} }
} }
// Else if not a WAL segment, see if it exists in the archiveId path // Else if not a WAL segment, see if it exists in the archiveId path
else if (storageExistsP( else if (
storageRepoIdx(cacheRepo->repoIdx), strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(cacheArchive->archiveId), storageExistsP(
strZ(archiveFileRequest)))) storageRepoIdx(cacheRepo->repoIdx),
strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(cacheArchive->archiveId), strZ(archiveFileRequest))))
{ {
MEM_CONTEXT_BEGIN(lstMemContext(getCheckResult->archiveFileMapList)) MEM_CONTEXT_BEGIN(lstMemContext(getCheckResult->archiveFileMapList))
{ {
@ -264,7 +265,6 @@ archiveGetFind(
getCheckResult->warnList = strLstMove(fileWarnList, memContextCurrent()); getCheckResult->warnList = strLstMove(fileWarnList, memContextCurrent());
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
// Else if a file was found // Else if a file was found
else if (!lstEmpty(matchList)) else if (!lstEmpty(matchList))

View File

@ -3,8 +3,8 @@ Archive Push File
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include "command/archive/push/file.h"
#include "command/archive/common.h" #include "command/archive/common.h"
#include "command/archive/push/file.h"
#include "command/control/common.h" #include "command/control/common.h"
#include "common/crypto/cipherBlock.h" #include "common/crypto/cipherBlock.h"
#include "common/crypto/hash.h" #include "common/crypto/hash.h"

View File

@ -17,8 +17,8 @@ Archive Push Command
#include "common/memContext.h" #include "common/memContext.h"
#include "common/wait.h" #include "common/wait.h"
#include "config/config.h" #include "config/config.h"
#include "config/load.h"
#include "config/exec.h" #include "config/exec.h"
#include "config/load.h"
#include "info/infoArchive.h" #include "info/infoArchive.h"
#include "postgres/interface.h" #include "postgres/interface.h"
#include "postgres/version.h" #include "postgres/version.h"

View File

@ -9,15 +9,15 @@ Backup Command
#include <unistd.h> #include <unistd.h>
#include "command/archive/common.h" #include "command/archive/common.h"
#include "command/control/common.h"
#include "command/backup/backup.h" #include "command/backup/backup.h"
#include "command/backup/common.h" #include "command/backup/common.h"
#include "command/backup/file.h" #include "command/backup/file.h"
#include "command/backup/protocol.h" #include "command/backup/protocol.h"
#include "command/check/common.h" #include "command/check/common.h"
#include "command/control/common.h"
#include "command/stanza/common.h" #include "command/stanza/common.h"
#include "common/crypto/cipherBlock.h"
#include "common/compress/helper.h" #include "common/compress/helper.h"
#include "common/crypto/cipherBlock.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/io/filter/size.h" #include "common/io/filter/size.h"
#include "common/lock.h" #include "common/lock.h"
@ -1671,7 +1671,8 @@ backupJobQueueNext(unsigned int clientIdx, int queueIdx, unsigned int queueTotal
} }
// Callback to fetch backup jobs for the parallel executor // Callback to fetch backup jobs for the parallel executor
static ProtocolParallelJob *backupJobCallback(void *data, unsigned int clientIdx) static ProtocolParallelJob *
backupJobCallback(void *data, unsigned int clientIdx)
{ {
FUNCTION_TEST_BEGIN(); FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM_P(VOID, data); FUNCTION_TEST_PARAM_P(VOID, data);

View File

@ -16,8 +16,8 @@ Block Incremental Filter
#include "common/io/filter/size.h" #include "common/io/filter/size.h"
#include "common/io/io.h" #include "common/io/io.h"
#include "common/log.h" #include "common/log.h"
#include "common/type/pack.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "common/type/pack.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Object type Object type

View File

@ -28,9 +28,9 @@ The block map is terminated by a varint-128 encoded zero stop byte.
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include "command/backup/blockMap.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h" #include "common/log.h"
#include "command/backup/blockMap.h"
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
typedef struct BlockMapRef typedef struct BlockMapRef

View File

@ -245,8 +245,7 @@ backupFile(
// Add block incremental filter // Add block incremental filter
ioFilterGroupAdd( ioFilterGroupAdd(
ioReadFilterGroup( ioReadFilterGroup(storageReadIo(read)),
storageReadIo(read)),
blockIncrNew( blockIncrNew(
(size_t)file->blockIncrSize, blockIncrReference, bundleId, bundleOffset, blockMap, compress, (size_t)file->blockIncrSize, blockIncrReference, bundleId, bundleOffset, blockMap, compress,
encrypt)); encrypt));

View File

@ -3,9 +3,9 @@ Page Checksum Filter
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include "command/backup/pageChecksum.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/io/filter/filter.h" #include "common/io/filter/filter.h"
#include "command/backup/pageChecksum.h"
#include "common/log.h" #include "common/log.h"
#include "common/macro.h" #include "common/macro.h"
#include "common/type/json.h" #include "common/type/json.h"

View File

@ -154,9 +154,12 @@ checkPrimary(const DbGetResult dbGroup)
storageRepo, repoArchiveId[repoIdx], walSegment, cfgOptionUInt64(cfgOptArchiveTimeout)); storageRepo, repoArchiveId[repoIdx], walSegment, cfgOptionUInt64(cfgOptArchiveTimeout));
LOG_INFO_FMT( LOG_INFO_FMT(
"WAL segment %s successfully archived to '%s' on %s", strZ(walSegment), "WAL segment %s successfully archived to '%s' on %s",
strZ(storagePathP(storageRepo, strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(repoArchiveId[repoIdx]), strZ(walSegment),
strZ(walSegmentFile)))), cfgOptionGroupName(cfgOptGrpRepo, repoIdx)); strZ(
storagePathP(
storageRepo, strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(repoArchiveId[repoIdx]), strZ(walSegmentFile)))),
cfgOptionGroupName(cfgOptGrpRepo, repoIdx));
} }
dbFree(dbGroup.primary); dbFree(dbGroup.primary);

View File

@ -151,7 +151,9 @@ checkStanzaInfoPg(
// Check that the version and system id match the current database // Check that the version and system id match the current database
if (pgVersion != archiveInfoPg.version || pgSystemId != archiveInfoPg.systemId) if (pgVersion != archiveInfoPg.version || pgSystemId != archiveInfoPg.systemId)
{ {
THROW(FileInvalidError, "backup and archive info files exist but do not match the database\n" THROW(
FileInvalidError,
"backup and archive info files exist but do not match the database\n"
"HINT: is this the correct stanza?\n" "HINT: is this the correct stanza?\n"
"HINT: did an error occur during stanza-upgrade?"); "HINT: did an error occur during stanza-upgrade?");
} }

View File

@ -4,8 +4,8 @@ Exit Routines
#ifndef COMMAND_EXIT_H #ifndef COMMAND_EXIT_H
#define COMMAND_EXIT_H #define COMMAND_EXIT_H
#include <stdbool.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h>
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Signal type Signal type

View File

@ -6,10 +6,10 @@ Expire Command
#include "command/archive/common.h" #include "command/archive/common.h"
#include "command/backup/common.h" #include "command/backup/common.h"
#include "command/control/common.h" #include "command/control/common.h"
#include "common/time.h"
#include "common/type/list.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/regExp.h" #include "common/regExp.h"
#include "common/time.h"
#include "common/type/list.h"
#include "config/config.h" #include "config/config.h"
#include "info/infoArchive.h" #include "info/infoArchive.h"
#include "info/infoBackup.h" #include "info/infoBackup.h"
@ -717,6 +717,7 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
// Track that this archive was removed // Track that this archive was removed
archiveExpire.total++; archiveExpire.total++;
archiveExpire.stop = strDup(strSubN(walSubPath, 0, 24)); archiveExpire.stop = strDup(strSubN(walSubPath, 0, 24));
if (archiveExpire.start == NULL) if (archiveExpire.start == NULL)
archiveExpire.start = strDup(strSubN(walSubPath, 0, 24)); archiveExpire.start = strDup(strSubN(walSubPath, 0, 24));
} }
@ -746,7 +747,6 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
.expression = WAL_TIMELINE_HISTORY_REGEXP_STR), .expression = WAL_TIMELINE_HISTORY_REGEXP_STR),
sortOrderAsc); sortOrderAsc);
for (unsigned int historyFileIdx = 0; historyFileIdx < strLstSize(historyFilesList); historyFileIdx++) for (unsigned int historyFileIdx = 0; historyFileIdx < strLstSize(historyFilesList); historyFileIdx++)
{ {
String *historyFile = strLstGet(historyFilesList, historyFileIdx); String *historyFile = strLstGet(historyFilesList, historyFileIdx);
@ -767,7 +767,6 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
strZ(archiveId), strZ(historyFile)); strZ(archiveId), strZ(historyFile));
} }
} }
} }
} }
} }

View File

@ -532,8 +532,9 @@ backupListAdd(
{ {
kvPut(varKv(link), KEY_NAME_VAR, varNewStr(target->file)); kvPut(varKv(link), KEY_NAME_VAR, varNewStr(target->file));
kvPut( kvPut(
varKv(link), KEY_DESTINATION_VAR, varNewStr(strNewFmt("%s/%s", strZ(target->path), varKv(link), KEY_DESTINATION_VAR,
strZ(target->file)))); varNewStr(strNewFmt("%s/%s", strZ(target->path), strZ(target->file))));
varLstAdd(linkSection, link); varLstAdd(linkSection, link);
} }
else else
@ -1552,7 +1553,6 @@ infoRender(void)
} }
else else
{ {
strCatFmt( strCatFmt(
resultStr, INFO_STANZA_STATUS_ERROR " (%s)\n", resultStr, INFO_STANZA_STATUS_ERROR " (%s)\n",
strZ(varStr(kvGet(repoStatus, STATUS_KEY_MESSAGE_VAR)))); strZ(varStr(kvGet(repoStatus, STATUS_KEY_MESSAGE_VAR))));

View File

@ -8,9 +8,9 @@ Repository Create Command
#include "common/memContext.h" #include "common/memContext.h"
#include "common/type/json.h" #include "common/type/json.h"
#include "config/config.h" #include "config/config.h"
#include "storage/helper.h"
#include "storage/azure/storage.intern.h" #include "storage/azure/storage.intern.h"
#include "storage/gcs/storage.intern.h" #include "storage/gcs/storage.intern.h"
#include "storage/helper.h"
#include "storage/s3/storage.intern.h" #include "storage/s3/storage.intern.h"
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/

View File

@ -121,8 +121,11 @@ storageGetProcess(IoWrite *destination)
!strEndsWithZ(file, BACKUP_MANIFEST_FILE INFO_COPY_EXT)) !strEndsWithZ(file, BACKUP_MANIFEST_FILE INFO_COPY_EXT))
{ {
const Manifest *manifest = manifestLoadFile( const Manifest *manifest = manifestLoadFile(
storageRepo(), strNewFmt(STORAGE_PATH_BACKUP "/%s/%s/%s", strZ(stanza), storageRepo(),
strZ(strLstGet(filePathSplitLst, 2)), BACKUP_MANIFEST_FILE), repoCipherType, cipherPass); strNewFmt(
STORAGE_PATH_BACKUP "/%s/%s/%s", strZ(stanza), strZ(strLstGet(filePathSplitLst, 2)),
BACKUP_MANIFEST_FILE),
repoCipherType, cipherPass);
cipherPass = manifestCipherSubPass(manifest); cipherPass = manifestCipherSubPass(manifest);
} }
} }

View File

@ -347,7 +347,8 @@ restoreBackupSet(void)
if (latestBackup.backupPgId < backupInfoPg.id) if (latestBackup.backupPgId < backupInfoPg.id)
{ {
THROW_FMT(BackupSetInvalidError, THROW_FMT(
BackupSetInvalidError,
"the latest backup set found '%s' is from a prior version of " PG_NAME "\n" "the latest backup set found '%s' is from a prior version of " PG_NAME "\n"
"HINT: was a backup created after the stanza-upgrade?\n" "HINT: was a backup created after the stanza-upgrade?\n"
"HINT: specify --" CFGOPT_SET " or --" CFGOPT_TYPE "=time/lsn to restore from a prior version of " "HINT: specify --" CFGOPT_SET " or --" CFGOPT_TYPE "=time/lsn to restore from a prior version of "
@ -2193,7 +2194,6 @@ restoreJobResult(const Manifest *manifest, ProtocolParallelJob *job, RegExp *zer
} }
} }
// Add bundle info // Add bundle info
strCatZ(log, " ("); strCatZ(log, " (");
@ -2269,7 +2269,8 @@ restoreJobQueueNext(unsigned int clientIdx, int queueIdx, unsigned int queueTota
} }
// Callback to fetch restore jobs for the parallel executor // Callback to fetch restore jobs for the parallel executor
static ProtocolParallelJob *restoreJobCallback(void *data, unsigned int clientIdx) static ProtocolParallelJob *
restoreJobCallback(void *data, unsigned int clientIdx)
{ {
FUNCTION_TEST_BEGIN(); FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM_P(VOID, data); FUNCTION_TEST_PARAM_P(VOID, data);

View File

@ -5,8 +5,8 @@ Server Ping Command
#include "command/server/ping.h" #include "command/server/ping.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/io/tls/client.h"
#include "common/io/socket/client.h" #include "common/io/socket/client.h"
#include "common/io/tls/client.h"
#include "config/config.h" #include "config/config.h"
#include "protocol/client.h" #include "protocol/client.h"
#include "protocol/helper.h" #include "protocol/helper.h"

View File

@ -3,9 +3,9 @@ Stanza Create Command
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include <inttypes.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "command/check/common.h" #include "command/check/common.h"
#include "command/control/common.h" #include "command/control/common.h"
@ -145,8 +145,8 @@ cmdStanzaCreate(void)
FileMissingError, FileMissingError,
"%s on %s\n" "%s on %s\n"
"HINT: this may be a symptom of repository corruption!", "HINT: this may be a symptom of repository corruption!",
((archiveInfoFileExists || archiveInfoFileCopyExists) ? (archiveInfoFileExists || archiveInfoFileCopyExists) ?
"archive.info exists but backup.info is missing" : "backup.info exists but archive.info is missing"), "archive.info exists but backup.info is missing" : "backup.info exists but archive.info is missing",
cfgOptionGroupName(cfgOptGrpRepo, repoIdx)); cfgOptionGroupName(cfgOptGrpRepo, repoIdx));
} }
} }

View File

@ -3,9 +3,9 @@ Stanza Delete Command
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include "command/backup/common.h"
#include "command/control/common.h" #include "command/control/common.h"
#include "command/stanza/delete.h" #include "command/stanza/delete.h"
#include "command/backup/common.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/memContext.h" #include "common/memContext.h"
#include "config/config.h" #include "config/config.h"

View File

@ -3,9 +3,9 @@ Stanza Update Command
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include <inttypes.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "command/check/common.h" #include "command/check/common.h"
#include "command/control/common.h" #include "command/control/common.h"

View File

@ -1341,6 +1341,7 @@ verifyRender(const List *const archiveIdResultList, const List *const backupResu
for (unsigned int archiveIdx = 0; archiveIdx < lstSize(archiveIdResultList); archiveIdx++) for (unsigned int archiveIdx = 0; archiveIdx < lstSize(archiveIdResultList); archiveIdx++)
{ {
VerifyArchiveResult *archiveIdResult = lstGet(archiveIdResultList, archiveIdx); VerifyArchiveResult *archiveIdResult = lstGet(archiveIdResultList, archiveIdx);
if (verboseText || archiveIdResult->totalWalFile - archiveIdResult->totalValidWal != 0) if (verboseText || archiveIdResult->totalWalFile - archiveIdResult->totalValidWal != 0)
{ {
strCatFmt( strCatFmt(
@ -1631,8 +1632,8 @@ verifyProcess(const bool verboseText)
// Add invalid file to the WAL range // Add invalid file to the WAL range
verifyAddInvalidWalFile( verifyAddInvalidWalFile(
archiveIdResult->walRangeList, verifyResult, filePathName, archiveIdResult->walRangeList, verifyResult, filePathName,
strSubN(strLstGet(filePathLst, strLstSize(filePathLst) - 1), 0, strSubN(
WAL_SEGMENT_NAME_SIZE)); strLstGet(filePathLst, strLstSize(filePathLst) - 1), 0, WAL_SEGMENT_NAME_SIZE));
} }
} }
else else

View File

@ -3,8 +3,8 @@ BZ2 Compress
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include <stdio.h>
#include <bzlib.h> #include <bzlib.h>
#include <stdio.h>
#include "common/compress/bz2/common.h" #include "common/compress/bz2/common.h"
#include "common/compress/bz2/compress.h" #include "common/compress/bz2/compress.h"

View File

@ -3,8 +3,8 @@ BZ2 Decompress
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include <stdio.h>
#include <bzlib.h> #include <bzlib.h>
#include <stdio.h>
#include "common/compress/bz2/common.h" #include "common/compress/bz2/common.h"
#include "common/compress/bz2/decompress.h" #include "common/compress/bz2/decompress.h"

View File

@ -5,13 +5,13 @@ Compression Helper
#include <string.h> #include <string.h>
#include "common/compress/helper.h"
#include "common/compress/bz2/common.h" #include "common/compress/bz2/common.h"
#include "common/compress/bz2/compress.h" #include "common/compress/bz2/compress.h"
#include "common/compress/bz2/decompress.h" #include "common/compress/bz2/decompress.h"
#include "common/compress/gz/common.h" #include "common/compress/gz/common.h"
#include "common/compress/gz/compress.h" #include "common/compress/gz/compress.h"
#include "common/compress/gz/decompress.h" #include "common/compress/gz/decompress.h"
#include "common/compress/helper.h"
#include "common/compress/lz4/common.h" #include "common/compress/lz4/common.h"
#include "common/compress/lz4/compress.h" #include "common/compress/lz4/compress.h"
#include "common/compress/lz4/decompress.h" #include "common/compress/lz4/decompress.h"

View File

@ -26,8 +26,8 @@ typedef enum
compressTypeXz, // xz/lzma compressTypeXz, // xz/lzma
} CompressType; } CompressType;
#include <common/type/stringId.h>
#include <common/io/filter/group.h> #include <common/io/filter/group.h>
#include <common/type/stringId.h>
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Compression types as a regexp. In the future this regexp will be generated automatically at build time but we want to wait until the Compression types as a regexp. In the future this regexp will be generated automatically at build time but we want to wait until the

View File

@ -7,8 +7,8 @@ Developed against version r131 using the documentation in https://github.com/lz4
#ifdef HAVE_LIBLZ4 #ifdef HAVE_LIBLZ4
#include <stdio.h>
#include <lz4frame.h> #include <lz4frame.h>
#include <stdio.h>
#include <string.h> #include <string.h>
#include "common/compress/lz4/common.h" #include "common/compress/lz4/common.h"

View File

@ -5,8 +5,8 @@ LZ4 Decompress
#ifdef HAVE_LIBLZ4 #ifdef HAVE_LIBLZ4
#include <stdio.h>
#include <lz4frame.h> #include <lz4frame.h>
#include <stdio.h>
#include "common/compress/lz4/common.h" #include "common/compress/lz4/common.h"
#include "common/compress/lz4/decompress.h" #include "common/compress/lz4/decompress.h"

View File

@ -5,8 +5,8 @@ Block Cipher
#include <string.h> #include <string.h>
#include <openssl/evp.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/evp.h>
#include "common/crypto/cipherBlock.h" #include "common/crypto/cipherBlock.h"
#include "common/crypto/common.h" #include "common/crypto/common.h"
@ -196,8 +196,7 @@ cipherBlockProcessBlock(CipherBlock *this, const unsigned char *source, size_t s
// Initialize cipher // Initialize cipher
cryptoError( cryptoError(
!EVP_CipherInit_ex( !EVP_CipherInit_ex(this->cipherContext, this->cipher, NULL, key, initVector, this->mode == cipherModeEncrypt),
this->cipherContext, this->cipher, NULL, key, initVector, this->mode == cipherModeEncrypt),
"unable to initialize cipher"); "unable to initialize cipher");
this->saltDone = true; this->saltDone = true;

View File

@ -4,8 +4,8 @@ Block Cipher Header
#ifndef COMMON_CRYPTO_CIPHERBLOCK_H #ifndef COMMON_CRYPTO_CIPHERBLOCK_H
#define COMMON_CRYPTO_CIPHERBLOCK_H #define COMMON_CRYPTO_CIPHERBLOCK_H
#include "common/io/filter/group.h"
#include "common/crypto/common.h" #include "common/crypto/common.h"
#include "common/io/filter/group.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Filter type constant Filter type constant

View File

@ -9,10 +9,10 @@ Crypto Common
#include <openssl/rand.h> #include <openssl/rand.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include "common/crypto/common.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/error.h" #include "common/error.h"
#include "common/log.h" #include "common/log.h"
#include "common/crypto/common.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Flag to indicate if OpenSSL has already been initialized Flag to indicate if OpenSSL has already been initialized

View File

@ -5,17 +5,17 @@ Cryptographic Hash
#include <string.h> #include <string.h>
#include <openssl/evp.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/hmac.h> #include <openssl/hmac.h>
#include "common/crypto/common.h"
#include "common/crypto/hash.h" #include "common/crypto/hash.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/io/filter/filter.h" #include "common/io/filter/filter.h"
#include "common/log.h" #include "common/log.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "common/type/pack.h" #include "common/type/pack.h"
#include "common/crypto/common.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Hashes for zero-length files (i.e., seed value) Hashes for zero-length files (i.e., seed value)

View File

@ -8,7 +8,8 @@ Debug Routines
#include "common/debug.h" #include "common/debug.h"
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN size_t objToLog(const void *const object, ObjToLogFormat formatFunc, char *const buffer, const size_t bufferSize) FN_EXTERN size_t
objToLog(const void *const object, ObjToLogFormat formatFunc, char *const buffer, const size_t bufferSize)
{ {
StringStatic debugLog = strStcInit(buffer, bufferSize); StringStatic debugLog = strStcInit(buffer, bufferSize);

View File

@ -6,8 +6,8 @@ Binary to String Encode/Decode
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include "common/encode.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/encode.h"
#include "common/error.h" #include "common/error.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -181,14 +181,16 @@ decodeToBinBase64(const char *source, unsigned char *destination)
// Second character is optional // Second character is optional
if (source[sourceIdx + 2] != 0x3d) if (source[sourceIdx + 2] != 0x3d)
{ {
destination[destinationIdx++] = (unsigned char) destination[destinationIdx++] =
(decodeBase64Lookup[(int)source[sourceIdx + 1]] << 4 | decodeBase64Lookup[(int)source[sourceIdx + 2]] >> 2); (unsigned char)
((decodeBase64Lookup[(int)source[sourceIdx + 1]] << 4) | (decodeBase64Lookup[(int)source[sourceIdx + 2]] >> 2));
} }
// Third character is optional // Third character is optional
if (source[sourceIdx + 3] != 0x3d) if (source[sourceIdx + 3] != 0x3d)
{ {
destination[destinationIdx++] = (unsigned char) destination[destinationIdx++] =
(unsigned char)
(((decodeBase64Lookup[(int)source[sourceIdx + 2]] << 6) & 0xc0) | decodeBase64Lookup[(int)source[sourceIdx + 3]]); (((decodeBase64Lookup[(int)source[sourceIdx + 2]] << 6) & 0xc0) | decodeBase64Lookup[(int)source[sourceIdx + 3]]);
} }
} }

View File

@ -99,7 +99,8 @@ static char messageBufferTemp[ERROR_MESSAGE_BUFFER_SIZE];
static char stackTraceBuffer[ERROR_MESSAGE_BUFFER_SIZE]; static char stackTraceBuffer[ERROR_MESSAGE_BUFFER_SIZE];
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN void errorHandlerSet(ErrorHandlerFunction *list, unsigned int total) FN_EXTERN void
errorHandlerSet(ErrorHandlerFunction *list, unsigned int total)
{ {
assert(total == 0 || list != NULL); assert(total == 0 || list != NULL);
@ -159,7 +160,8 @@ errorTypeParent(const ErrorType *errorType)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN unsigned int errorTryDepth(void) FN_EXTERN unsigned int
errorTryDepth(void)
{ {
return (unsigned int)errorContext.tryTotal; return (unsigned int)errorContext.tryTotal;
} }
@ -434,6 +436,7 @@ errorInternalThrowSys(
} }
#ifdef DEBUG_COVERAGE #ifdef DEBUG_COVERAGE
FN_EXTERN void FN_EXTERN void
errorInternalThrowOnSys( errorInternalThrowOnSys(
bool error, int errNo, const ErrorType *errorType, const char *fileName, const char *functionName, int fileLine, bool error, int errNo, const ErrorType *errorType, const char *fileName, const char *functionName, int fileLine,
@ -442,6 +445,7 @@ errorInternalThrowOnSys(
if (error) if (error)
errorInternalThrowSys(errNo, errorType, fileName, functionName, fileLine, message); errorInternalThrowSys(errNo, errorType, fileName, functionName, fileLine, message);
} }
#endif #endif
FN_EXTERN void FN_EXTERN void
@ -462,6 +466,7 @@ errorInternalThrowSysFmt(
} }
#ifdef DEBUG_COVERAGE #ifdef DEBUG_COVERAGE
FN_EXTERN void FN_EXTERN void
errorInternalThrowOnSysFmt( errorInternalThrowOnSysFmt(
bool error, int errNo, const ErrorType *errorType, const char *fileName, const char *functionName, int fileLine, bool error, int errNo, const ErrorType *errorType, const char *fileName, const char *functionName, int fileLine,
@ -485,4 +490,5 @@ errorInternalThrowOnSysFmt(
errorInternalThrow(errorType, fileName, functionName, fileLine, messageBufferTemp, NULL); errorInternalThrow(errorType, fileName, functionName, fileLine, messageBufferTemp, NULL);
} }
} }
#endif #endif

View File

@ -11,7 +11,6 @@ Execute Process
#include <unistd.h> #include <unistd.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/exec.h" #include "common/exec.h"
#include "common/fork.h" #include "common/fork.h"
#include "common/io/fdRead.h" #include "common/io/fdRead.h"
@ -19,6 +18,7 @@ Execute Process
#include "common/io/io.h" #include "common/io/io.h"
#include "common/io/read.h" #include "common/io/read.h"
#include "common/io/write.h" #include "common/io/write.h"
#include "common/log.h"
#include "common/wait.h" #include "common/wait.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -8,8 +8,8 @@ Ini Handler
#include <string.h> #include <string.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/ini.h" #include "common/ini.h"
#include "common/log.h"
#include "common/type/json.h" #include "common/type/json.h"
#include "common/type/keyValue.h" #include "common/type/keyValue.h"

View File

@ -11,8 +11,8 @@ Object type
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
typedef struct HttpSession HttpSession; typedef struct HttpSession HttpSession;
#include "common/io/read.h"
#include "common/io/http/client.h" #include "common/io/http/client.h"
#include "common/io/read.h"
#include "common/io/session.h" #include "common/io/session.h"
#include "common/io/write.h" #include "common/io/write.h"
#include "common/type/object.h" #include "common/type/object.h"

View File

@ -5,8 +5,8 @@ HTTP URL
#include "common/debug.h" #include "common/debug.h"
#include "common/io/http/url.h" #include "common/io/http/url.h"
#include "common/type/stringList.h"
#include "common/regExp.h" #include "common/regExp.h"
#include "common/type/stringList.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Regular expression for URLs. This is not intended to be completely comprehensive, e.g. it is still possible to enter bad hostnames. Regular expression for URLs. This is not intended to be completely comprehensive, e.g. it is still possible to enter bad hostnames.

View File

@ -11,8 +11,8 @@ Object type
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
typedef struct HttpUrl HttpUrl; typedef struct HttpUrl HttpUrl;
#include "common/type/param.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "common/type/param.h"
#include "common/type/string.h" #include "common/type/string.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -4,16 +4,16 @@ Socket Client
#include "build.auto.h" #include "build.auto.h"
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/io/client.h" #include "common/io/client.h"
#include "common/io/socket/client.h" #include "common/io/socket/client.h"
#include "common/io/socket/common.h" #include "common/io/socket/common.h"
#include "common/io/socket/session.h" #include "common/io/socket/session.h"
#include "common/log.h"
#include "common/stat.h" #include "common/stat.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "common/wait.h" #include "common/wait.h"

View File

@ -4,16 +4,16 @@ Socket Server
#include "build.auto.h" #include "build.auto.h"
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/io/server.h" #include "common/io/server.h"
#include "common/io/socket/server.h"
#include "common/io/socket/common.h" #include "common/io/socket/common.h"
#include "common/io/socket/server.h"
#include "common/io/socket/session.h" #include "common/io/socket/session.h"
#include "common/log.h"
#include "common/memContext.h" #include "common/memContext.h"
#include "common/stat.h" #include "common/stat.h"
#include "common/type/object.h" #include "common/type/object.h"

View File

@ -6,11 +6,11 @@ Socket Session
#include <unistd.h> #include <unistd.h>
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/io/fdRead.h" #include "common/io/fdRead.h"
#include "common/io/fdWrite.h" #include "common/io/fdWrite.h"
#include "common/io/socket/client.h"
#include "common/io/session.h" #include "common/io/session.h"
#include "common/io/socket/client.h"
#include "common/log.h"
#include "common/type/object.h" #include "common/type/object.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -7,12 +7,12 @@ TLS Client
#include "common/crypto/common.h" #include "common/crypto/common.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/io/client.h" #include "common/io/client.h"
#include "common/io/io.h" #include "common/io/io.h"
#include "common/io/tls/client.h" #include "common/io/tls/client.h"
#include "common/io/tls/common.h" #include "common/io/tls/common.h"
#include "common/io/tls/session.h" #include "common/io/tls/session.h"
#include "common/log.h"
#include "common/stat.h" #include "common/stat.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "common/wait.h" #include "common/wait.h"

View File

@ -79,8 +79,10 @@ tlsCertCommonName(X509 *const certificate)
static int static int
tlsCertPwd(char *buffer, const int size, const int rwFlag, void *const userData) tlsCertPwd(char *buffer, const int size, const int rwFlag, void *const userData)
{ {
(void)rwFlag;
(void)userData;
CHECK(ServiceError, size > 0, "buffer has zero size"); CHECK(ServiceError, size > 0, "buffer has zero size");
(void)rwFlag; (void)userData;
// No password is currently supplied // No password is currently supplied
buffer[0] = '\0'; buffer[0] = '\0';

View File

@ -4,19 +4,19 @@ TLS Server
#include "build.auto.h" #include "build.auto.h"
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <openssl/err.h> #include <openssl/err.h>
#include "common/crypto/common.h" #include "common/crypto/common.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/io/server.h" #include "common/io/server.h"
#include "common/io/tls/common.h" #include "common/io/tls/common.h"
#include "common/io/tls/server.h" #include "common/io/tls/server.h"
#include "common/io/tls/session.h" #include "common/io/tls/session.h"
#include "common/log.h"
#include "common/stat.h" #include "common/stat.h"
#include "common/type/object.h" #include "common/type/object.h"
@ -309,7 +309,8 @@ tlsServerNew(
memContextCallbackSet(objMemContext(driver), tlsServerFreeResource, driver); memContextCallbackSet(objMemContext(driver), tlsServerFreeResource, driver);
// Set options // Set options
SSL_CTX_set_options(driver->context, SSL_CTX_set_options(
driver->context,
// Disable SSL and TLS v1/v1.1 // Disable SSL and TLS v1/v1.1
SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 |
// Let server set cipher order // Let server set cipher order

View File

@ -177,7 +177,8 @@ static MemContextCallbackOne *
memContextCallbackOne(MemContext *const memContext) memContextCallbackOne(MemContext *const memContext)
{ {
return return
(MemContextCallbackOne *)((unsigned char *)(memContext + 1) + (MemContextCallbackOne *)
((unsigned char *)(memContext + 1) +
memContextSizePossible[memContext->childQty][memContext->allocQty][0] + memContext->allocExtra); memContextSizePossible[memContext->childQty][memContext->allocQty][0] + memContext->allocExtra);
} }

View File

@ -8,8 +8,8 @@ Stack Trace Handler
#include <string.h> #include <string.h>
#ifdef HAVE_LIBBACKTRACE #ifdef HAVE_LIBBACKTRACE
#include <backtrace.h>
#include <backtrace-supported.h> #include <backtrace-supported.h>
#include <backtrace.h>
#endif #endif
#include "common/assert.h" #include "common/assert.h"

View File

@ -84,5 +84,4 @@ blbAdd(Blob *const this, const void *const data, const size_t size)
MEM_CONTEXT_OBJ_END(); MEM_CONTEXT_OBJ_END();
FUNCTION_TEST_RETURN_P(VOID, result); FUNCTION_TEST_RETURN_P(VOID, result);
} }

View File

@ -349,6 +349,6 @@ FN_EXTERN void
bufToLog(const Buffer *const this, StringStatic *const debugLog) bufToLog(const Buffer *const this, StringStatic *const debugLog)
{ {
strStcFmt( strStcFmt(
debugLog, "{used: %zu, size: %zu%s", bufUsed(this), bufSize(this), bufSizeLimit(this) ? zNewFmt(", sizeAlloc: %zu}", debugLog, "{used: %zu, size: %zu%s", bufUsed(this), bufSize(this),
bufSizeAlloc(this)) : "}"); bufSizeLimit(this) ? zNewFmt(", sizeAlloc: %zu}", bufSizeAlloc(this)) : "}");
} }

View File

@ -572,7 +572,7 @@ jsonReadKeyZN(JsonRead *const this)
THROW(JsonFormatError, "expected '\"' but found null delimiter"); THROW(JsonFormatError, "expected '\"' but found null delimiter");
this->json++; this->json++;
}; }
// Set key size // Set key size
result.size = (size_t)(this->json - result.buffer); result.size = (size_t)(this->json - result.buffer);
@ -845,7 +845,7 @@ jsonReadSkipStr(JsonRead *const this)
THROW(JsonFormatError, "expected '\"' but found null delimiter"); THROW(JsonFormatError, "expected '\"' but found null delimiter");
this->json++; this->json++;
}; }
// Advance the character array pointer to the next element after the string // Advance the character array pointer to the next element after the string
this->json++; this->json++;

View File

@ -170,7 +170,8 @@ strNewZ(const char *const string)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN String *strNewDbl(double value) FN_EXTERN String *
strNewDbl(double value)
{ {
FUNCTION_TEST_BEGIN(); FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(DOUBLE, value); FUNCTION_TEST_PARAM(DOUBLE, value);

View File

@ -43,7 +43,8 @@ messages need to be accumulated and then returned together.
This empty function is required because without it libxml2 will dump errors to stdout. Really. This empty function is required because without it libxml2 will dump errors to stdout. Really.
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
static void xmlErrorHandler(void *ctx, const char *format, ...) static void
xmlErrorHandler(void *ctx, const char *format, ...)
{ {
(void)ctx; (void)ctx;
(void)format; (void)format;

View File

@ -460,7 +460,6 @@ cfgOptionDefaultSet(ConfigOption optionId, const Variant *defaultValue)
FUNCTION_TEST_RETURN_VOID(); FUNCTION_TEST_RETURN_VOID();
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN const String * FN_EXTERN const String *
cfgOptionDisplayVar(const Variant *const value, const ConfigOptionType optionType) cfgOptionDisplayVar(const Variant *const value, const ConfigOptionType optionType)
@ -524,7 +523,6 @@ cfgOptionIdxDisplay(const ConfigOption optionId, const unsigned int optionIdx)
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
FUNCTION_TEST_RETURN_CONST(STRING, option->display); FUNCTION_TEST_RETURN_CONST(STRING, option->display);
} }

View File

@ -10,19 +10,19 @@ Configuration Load
#include "command/command.h" #include "command/command.h"
#include "common/compress/helper.intern.h" #include "common/compress/helper.intern.h"
#include "common/crypto/common.h" #include "common/crypto/common.h"
#include "common/memContext.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/io/io.h" #include "common/io/io.h"
#include "common/io/socket/common.h" #include "common/io/socket/common.h"
#include "common/lock.h" #include "common/lock.h"
#include "common/log.h" #include "common/log.h"
#include "common/memContext.h"
#include "config/config.intern.h" #include "config/config.intern.h"
#include "config/load.h" #include "config/load.h"
#include "config/parse.h" #include "config/parse.h"
#include "info/infoBackup.h" #include "info/infoBackup.h"
#include "storage/cifs/storage.h" #include "storage/cifs/storage.h"
#include "storage/posix/storage.h"
#include "storage/helper.h" #include "storage/helper.h"
#include "storage/posix/storage.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Load log settings Load log settings
@ -219,11 +219,11 @@ cfgLoadUpdateOption(void)
{ {
case backupTypeFull: case backupTypeFull:
{ {
if (cfgOptionIdxStrId(cfgOptRepoRetentionFullType, optionIdx) == if (cfgOptionIdxStrId(cfgOptRepoRetentionFullType, optionIdx) == CFGOPTVAL_REPO_RETENTION_FULL_TYPE_COUNT &&
CFGOPTVAL_REPO_RETENTION_FULL_TYPE_COUNT &&
cfgOptionIdxTest(cfgOptRepoRetentionFull, optionIdx)) cfgOptionIdxTest(cfgOptRepoRetentionFull, optionIdx))
{ {
cfgOptionIdxSet(cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault, cfgOptionIdxSet(
cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault,
VARINT64(cfgOptionIdxInt64(cfgOptRepoRetentionFull, optionIdx))); VARINT64(cfgOptionIdxInt64(cfgOptRepoRetentionFull, optionIdx)));
} }
@ -235,7 +235,8 @@ cfgLoadUpdateOption(void)
// if repo-retention-diff is set then user must have set it // if repo-retention-diff is set then user must have set it
if (cfgOptionIdxTest(cfgOptRepoRetentionDiff, optionIdx)) if (cfgOptionIdxTest(cfgOptRepoRetentionDiff, optionIdx))
{ {
cfgOptionIdxSet(cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault, cfgOptionIdxSet(
cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault,
VARINT64(cfgOptionIdxInt64(cfgOptRepoRetentionDiff, optionIdx))); VARINT64(cfgOptionIdxInt64(cfgOptRepoRetentionDiff, optionIdx)));
} }
else else

View File

@ -1252,9 +1252,10 @@ cfgFileLoadPart(String **config, const Buffer *configPart)
} }
static String * static String *
cfgFileLoad( // NOTE: Passing defaults to enable more complete test coverage cfgFileLoad(
const Storage *storage, // Storage to load configs const Storage *storage, // Storage to load configs
const ParseOption *optionList, // All options and their current settings const ParseOption *optionList, // All options and their current settings
// NOTE: Passing defaults to enable more complete test coverage
const String *optConfigDefault, // Current default for --config option const String *optConfigDefault, // Current default for --config option
const String *optConfigIncludePathDefault, // Current default for --config-include-path option const String *optConfigIncludePathDefault, // Current default for --config-include-path option
const String *origConfigDefault) // Original --config option default (/etc/pgbackrest.conf) const String *origConfigDefault) // Original --config option default (/etc/pgbackrest.conf)

View File

@ -618,7 +618,6 @@ dbReplayWait(Db *const this, const String *const targetLsn, const uint32_t targe
MEM_CONTEXT_TEMP_BEGIN() MEM_CONTEXT_TEMP_BEGIN()
{ {
// Standby checkpoint before the backup started must be <= the target LSN. If not, it indicates that the standby was ahead // Standby checkpoint before the backup started must be <= the target LSN. If not, it indicates that the standby was ahead
// of the primary and cannot be following it. // of the primary and cannot be following it.
if (dbPgControl(this).checkpoint > pgLsnFromStr(targetLsn)) if (dbPgControl(this).checkpoint > pgLsnFromStr(targetLsn))

View File

@ -7,12 +7,12 @@ Info Handler
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "common/type/convert.h"
#include "common/crypto/hash.h" #include "common/crypto/hash.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/io/filter/filter.h"
#include "common/ini.h" #include "common/ini.h"
#include "common/io/filter/filter.h"
#include "common/log.h" #include "common/log.h"
#include "common/type/convert.h"
#include "common/type/json.h" #include "common/type/json.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "info/info.h" #include "info/info.h"

View File

@ -3,17 +3,17 @@ Archive Info Handler
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include <inttypes.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "common/crypto/cipherBlock.h" #include "common/crypto/cipherBlock.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h"
#include "common/ini.h" #include "common/ini.h"
#include "common/io/bufferWrite.h" #include "common/io/bufferWrite.h"
#include "common/io/io.h" #include "common/io/io.h"
#include "common/log.h"
#include "info/infoArchive.h" #include "info/infoArchive.h"
#include "info/infoPg.h" #include "info/infoPg.h"
#include "postgres/interface.h" #include "postgres/interface.h"

View File

@ -3,10 +3,10 @@ Backup Info Handler
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include <inttypes.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include "command/backup/common.h" #include "command/backup/common.h"
#include "common/crypto/cipherBlock.h" #include "common/crypto/cipherBlock.h"
@ -150,7 +150,6 @@ infoBackupLoadCallback(void *data, const String *section, const String *key, con
InfoBackupData info = InfoBackupData info =
{ {
.backupLabel = strDup(key), .backupLabel = strDup(key),
}; };
// Format and version // Format and version

View File

@ -6,8 +6,8 @@ PostgreSQL Info Handler
#include <limits.h> #include <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include "common/debug.h" #include "common/debug.h"

View File

@ -125,5 +125,4 @@ FN_EXTERN void infoPgDataToLog(const InfoPgData *this, StringStatic *debugLog);
#define FUNCTION_LOG_INFO_PG_DATA_FORMAT(value, buffer, bufferSize) \ #define FUNCTION_LOG_INFO_PG_DATA_FORMAT(value, buffer, bufferSize) \
FUNCTION_LOG_OBJECT_FORMAT(&value, infoPgDataToLog, buffer, bufferSize) FUNCTION_LOG_OBJECT_FORMAT(&value, infoPgDataToLog, buffer, bufferSize)
#endif #endif

View File

@ -1528,7 +1528,8 @@ manifestBuildValidate(Manifest *this, bool delta, time_t copyStart, CompressType
{ {
LOG_WARN_FMT( LOG_WARN_FMT(
"file '%s' has timestamp (%" PRId64 ") in the future (relative to copy start %" PRId64 "), enabling delta" "file '%s' has timestamp (%" PRId64 ") in the future (relative to copy start %" PRId64 "), enabling delta"
" checksum", strZ(manifestPathPg(file.name)), (int64_t)file.timestamp, (int64_t)copyStart); " checksum",
strZ(manifestPathPg(file.name)), (int64_t)file.timestamp, (int64_t)copyStart);
this->pub.data.backupOptionDelta = BOOL_TRUE_VAR; this->pub.data.backupOptionDelta = BOOL_TRUE_VAR;
break; break;
@ -1744,7 +1745,6 @@ manifestBuildComplete(
pckReadArrayEndP(read); pckReadArrayEndP(read);
manifestDbAdd(this, &(ManifestDb){.id = id, .name = name, .lastSystemId = lastSystemId}); manifestDbAdd(this, &(ManifestDb){.id = id, .name = name, .lastSystemId = lastSystemId});
} }
lstSort(this->pub.dbList, sortOrderAsc); lstSort(this->pub.dbList, sortOrderAsc);
@ -2051,7 +2051,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
manifestFileAdd(manifest, &file); manifestFileAdd(manifest, &file);
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_TARGET_PATH)) else if (strEqZ(section, MANIFEST_SECTION_TARGET_PATH))
{ {
@ -2082,7 +2081,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
lstAdd(loadData->pathFoundList, &valueFound); lstAdd(loadData->pathFoundList, &valueFound);
manifestPathAdd(manifest, &path); manifestPathAdd(manifest, &path);
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_TARGET_LINK)) else if (strEqZ(section, MANIFEST_SECTION_TARGET_LINK))
{ {
@ -2112,7 +2110,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
lstAdd(loadData->linkFoundList, &valueFound); lstAdd(loadData->linkFoundList, &valueFound);
manifestLinkAdd(manifest, &link); manifestLinkAdd(manifest, &link);
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_TARGET_FILE_DEFAULT)) else if (strEqZ(section, MANIFEST_SECTION_TARGET_FILE_DEFAULT))
{ {
@ -2127,7 +2124,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_TARGET_PATH_DEFAULT)) else if (strEqZ(section, MANIFEST_SECTION_TARGET_PATH_DEFAULT))
{ {
@ -2142,7 +2138,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_TARGET_LINK_DEFAULT)) else if (strEqZ(section, MANIFEST_SECTION_TARGET_LINK_DEFAULT))
{ {
@ -2155,7 +2150,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_BACKUP_TARGET)) else if (strEqZ(section, MANIFEST_SECTION_BACKUP_TARGET))
{ {
@ -2186,7 +2180,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
manifestTargetAdd(manifest, &target); manifestTargetAdd(manifest, &target);
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_DB)) else if (strEqZ(section, MANIFEST_SECTION_DB))
{ {
@ -2203,7 +2196,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
manifestDbAdd(manifest, &db); manifestDbAdd(manifest, &db);
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_METADATA)) else if (strEqZ(section, MANIFEST_SECTION_METADATA))
{ {
@ -2214,7 +2206,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_BACKUP)) else if (strEqZ(section, MANIFEST_SECTION_BACKUP))
{ {
@ -2257,7 +2248,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
} }
MEM_CONTEXT_END(); MEM_CONTEXT_END();
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_BACKUP_DB)) else if (strEqZ(section, MANIFEST_SECTION_BACKUP_DB))
{ {
@ -2270,7 +2260,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
else if (strEqZ(key, MANIFEST_KEY_DB_VERSION)) else if (strEqZ(key, MANIFEST_KEY_DB_VERSION))
manifest->pub.data.pgVersion = pgVersionFromStr(varStr(jsonToVar(value))); manifest->pub.data.pgVersion = pgVersionFromStr(varStr(jsonToVar(value)));
} }
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
else if (strEqZ(section, MANIFEST_SECTION_BACKUP_OPTION)) else if (strEqZ(section, MANIFEST_SECTION_BACKUP_OPTION))
{ {
@ -2485,7 +2474,8 @@ manifestSaveCallback(void *const callbackData, const String *const sectionNext,
if (manifest->pub.data.lsnStart != NULL) if (manifest->pub.data.lsnStart != NULL)
{ {
infoSaveValue( infoSaveValue(
infoSaveData, MANIFEST_SECTION_BACKUP, MANIFEST_KEY_BACKUP_LSN_START, jsonFromVar(VARSTR(manifest->pub.data.lsnStart))); infoSaveData, MANIFEST_SECTION_BACKUP, MANIFEST_KEY_BACKUP_LSN_START,
jsonFromVar(VARSTR(manifest->pub.data.lsnStart)));
} }
if (manifest->pub.data.lsnStop != NULL) if (manifest->pub.data.lsnStop != NULL)

View File

@ -36,8 +36,8 @@ typedef struct Manifest Manifest;
#include "common/compress/helper.h" #include "common/compress/helper.h"
#include "common/crypto/common.h" #include "common/crypto/common.h"
#include "common/crypto/hash.h" #include "common/crypto/hash.h"
#include "common/type/variant.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "common/type/variant.h"
#include "info/info.h" #include "info/info.h"
#include "info/infoBackup.h" #include "info/infoBackup.h"
#include "storage/storage.h" #include "storage/storage.h"

View File

@ -8,10 +8,10 @@ casts to queries to output one of these types.
#ifndef POSTGRES_QUERY_H #ifndef POSTGRES_QUERY_H
#define POSTGRES_QUERY_H #define POSTGRES_QUERY_H
#include "common/time.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "common/type/pack.h" #include "common/type/pack.h"
#include "common/type/string.h" #include "common/type/string.h"
#include "common/time.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Query result types Query result types

View File

@ -22,6 +22,7 @@ If a comment has changed in a way that implies a difference in the way the type
should be created. See the CheckPoint type difference between 9.5 and 9.6 as an example. should be created. See the CheckPoint type difference between 9.5 and 9.6 as an example.
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "postgres/interface/static.vendor.h" #include "postgres/interface/static.vendor.h"
#include "postgres/version.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Types from src/include/c.h Types from src/include/c.h

View File

@ -6,8 +6,8 @@ Protocol Command
#include "common/debug.h" #include "common/debug.h"
#include "common/log.h" #include "common/log.h"
#include "common/type/keyValue.h" #include "common/type/keyValue.h"
#include "protocol/command.h"
#include "protocol/client.h" #include "protocol/client.h"
#include "protocol/command.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Object type Object type

View File

@ -165,7 +165,9 @@ storageAzureAuth(
// Generate authorization header // Generate authorization header
httpHeaderPut( httpHeaderPut(
httpHeader, HTTP_HEADER_AUTHORIZATION_STR, strNewFmt("SharedKey %s:%s", strZ(this->account), httpHeader, HTTP_HEADER_AUTHORIZATION_STR,
strNewFmt(
"SharedKey %s:%s", strZ(this->account),
strZ(strNewEncode(encodingBase64, cryptoHmacOne(hashTypeSha256, this->sharedKey, BUFSTR(stringToSign)))))); strZ(strNewEncode(encodingBase64, cryptoHmacOne(hashTypeSha256, this->sharedKey, BUFSTR(stringToSign))))));
} }
// SAS authentication // SAS authentication

View File

@ -6,8 +6,8 @@ GCS Storage
#include <string.h> #include <string.h>
#include <openssl/bio.h> #include <openssl/bio.h>
#include <openssl/x509.h>
#include <openssl/pem.h> #include <openssl/pem.h>
#include <openssl/x509.h>
#include "common/crypto/common.h" #include "common/crypto/common.h"
#include "common/crypto/hash.h" #include "common/crypto/hash.h"

View File

@ -256,7 +256,6 @@ storageWriteGcs(THIS_VOID, const Buffer *buffer)
} }
while (bytesTotal != bufUsed(buffer)); while (bytesTotal != bufUsed(buffer));
FUNCTION_LOG_RETURN_VOID(); FUNCTION_LOG_RETURN_VOID();
} }

View File

@ -11,9 +11,9 @@ Storage Helper
#include "common/regExp.h" #include "common/regExp.h"
#include "config/config.h" #include "config/config.h"
#include "protocol/helper.h" #include "protocol/helper.h"
#include "storage/helper.h"
#include "storage/posix/storage.h" #include "storage/posix/storage.h"
#include "storage/remote/storage.h" #include "storage/remote/storage.h"
#include "storage/helper.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Storage path constants Storage path constants
@ -84,7 +84,8 @@ storageHelperContextInit(void)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN void storageHelperInit(const StorageHelper *const helperList) FN_EXTERN void
storageHelperInit(const StorageHelper *const helperList)
{ {
FUNCTION_TEST_BEGIN(); FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM_P(VOID, helperList); FUNCTION_TEST_PARAM_P(VOID, helperList);

View File

@ -87,8 +87,12 @@ storageItrPathAdd(StorageIterator *const this, const String *const pathSub)
OBJ_NEW_BEGIN(StorageIteratorInfo, .childQty = MEM_CONTEXT_QTY_MAX, .allocQty = 1) OBJ_NEW_BEGIN(StorageIteratorInfo, .childQty = MEM_CONTEXT_QTY_MAX, .allocQty = 1)
{ {
StorageIteratorInfo *const listInfo = OBJ_NEW_ALLOC(); StorageIteratorInfo *const listInfo = OBJ_NEW_ALLOC();
*listInfo = (StorageIteratorInfo){
.pathSub = strDup(pathSub), .list = storageLstMove(list, memContextCurrent())}; *listInfo = (StorageIteratorInfo)
{
.pathSub = strDup(pathSub),
.list = storageLstMove(list, memContextCurrent()),
};
lstAdd(this->stack, &listInfo); lstAdd(this->stack, &listInfo);
} }
@ -259,7 +263,8 @@ storageItrMore(StorageIterator *const this)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN StorageInfo storageItrNext(StorageIterator *const this) FN_EXTERN StorageInfo
storageItrNext(StorageIterator *const this)
{ {
FUNCTION_TEST_BEGIN(); FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(STORAGE_ITERATOR, this); FUNCTION_TEST_PARAM(STORAGE_ITERATOR, this);

View File

@ -21,6 +21,8 @@ typedef struct StorageReadInterface
IoReadInterface ioInterface; IoReadInterface ioInterface;
} StorageReadInterface; } StorageReadInterface;
#include "storage/read.h"
FN_EXTERN StorageRead *storageReadNew(void *driver, const StorageReadInterface *interface); FN_EXTERN StorageRead *storageReadNew(void *driver, const StorageReadInterface *interface);
#endif #endif

View File

@ -11,8 +11,8 @@ Remote Storage Protocol Handler
#include "common/type/pack.h" #include "common/type/pack.h"
#include "config/config.h" #include "config/config.h"
#include "protocol/helper.h" #include "protocol/helper.h"
#include "storage/remote/protocol.h"
#include "storage/helper.h" #include "storage/helper.h"
#include "storage/remote/protocol.h"
#include "storage/storage.intern.h" #include "storage/storage.intern.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************

View File

@ -13,9 +13,9 @@ Remote Storage Read
#include "common/log.h" #include "common/log.h"
#include "common/type/convert.h" #include "common/type/convert.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "storage/read.intern.h"
#include "storage/remote/protocol.h" #include "storage/remote/protocol.h"
#include "storage/remote/read.h" #include "storage/remote/read.h"
#include "storage/read.intern.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Object type Object type

View File

@ -5,8 +5,8 @@ Remote Storage Read
#define STORAGE_REMOTE_READ_H #define STORAGE_REMOTE_READ_H
#include "protocol/client.h" #include "protocol/client.h"
#include "storage/remote/storage.intern.h"
#include "storage/read.h" #include "storage/read.h"
#include "storage/remote/storage.intern.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Constructors Constructors

View File

@ -81,12 +81,12 @@ storageS3Helper(const unsigned int repoIdx, const bool write, StoragePathExpress
MEM_CONTEXT_PRIOR_BEGIN() MEM_CONTEXT_PRIOR_BEGIN()
{ {
result = storageS3New( result = storageS3New(
cfgOptionIdxStr(cfgOptRepoPath, repoIdx), write, pathExpressionCallback, cfgOptionIdxStr(cfgOptRepoS3Bucket, repoIdx), cfgOptionIdxStr(cfgOptRepoPath, repoIdx), write, pathExpressionCallback,
endPoint, (StorageS3UriStyle)cfgOptionIdxStrId(cfgOptRepoS3UriStyle, repoIdx), cfgOptionIdxStr(cfgOptRepoS3Bucket, repoIdx), endPoint,
cfgOptionIdxStr(cfgOptRepoS3Region, repoIdx), keyType, cfgOptionIdxStrNull(cfgOptRepoS3Key, repoIdx), (StorageS3UriStyle)cfgOptionIdxStrId(cfgOptRepoS3UriStyle, repoIdx), cfgOptionIdxStr(cfgOptRepoS3Region, repoIdx),
cfgOptionIdxStrNull(cfgOptRepoS3KeySecret, repoIdx), cfgOptionIdxStrNull(cfgOptRepoS3Token, repoIdx), keyType, cfgOptionIdxStrNull(cfgOptRepoS3Key, repoIdx), cfgOptionIdxStrNull(cfgOptRepoS3KeySecret, repoIdx),
cfgOptionIdxStrNull(cfgOptRepoS3KmsKeyId, repoIdx), role, webIdToken, cfgOptionIdxStrNull(cfgOptRepoS3Token, repoIdx), cfgOptionIdxStrNull(cfgOptRepoS3KmsKeyId, repoIdx), role,
(size_t)cfgOptionIdxUInt64(cfgOptRepoStorageUploadChunkSize, repoIdx), host, port, ioTimeoutMs(), webIdToken, (size_t)cfgOptionIdxUInt64(cfgOptRepoStorageUploadChunkSize, repoIdx), host, port, ioTimeoutMs(),
cfgOptionIdxBool(cfgOptRepoStorageVerifyTls, repoIdx), cfgOptionIdxStrNull(cfgOptRepoStorageCaFile, repoIdx), cfgOptionIdxBool(cfgOptRepoStorageVerifyTls, repoIdx), cfgOptionIdxStrNull(cfgOptRepoStorageCaFile, repoIdx),
cfgOptionIdxStrNull(cfgOptRepoStorageCaPath, repoIdx)); cfgOptionIdxStrNull(cfgOptRepoStorageCaPath, repoIdx));
} }

View File

@ -7,8 +7,8 @@ S3 Storage Read
#include "common/io/http/client.h" #include "common/io/http/client.h"
#include "common/log.h" #include "common/log.h"
#include "common/type/object.h" #include "common/type/object.h"
#include "storage/s3/read.h"
#include "storage/read.intern.h" #include "storage/read.intern.h"
#include "storage/s3/read.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Object type Object type

View File

@ -4,8 +4,8 @@ S3 Storage Read
#ifndef STORAGE_S3_READ_H #ifndef STORAGE_S3_READ_H
#define STORAGE_S3_READ_H #define STORAGE_S3_READ_H
#include "storage/s3/storage.intern.h"
#include "storage/read.h" #include "storage/read.h"
#include "storage/s3/storage.intern.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Constructors Constructors

View File

@ -13,8 +13,8 @@ S3 Storage
#include "common/io/tls/client.h" #include "common/io/tls/client.h"
#include "common/log.h" #include "common/log.h"
#include "common/regExp.h" #include "common/regExp.h"
#include "common/type/object.h"
#include "common/type/json.h" #include "common/type/json.h"
#include "common/type/object.h"
#include "common/type/xml.h" #include "common/type/xml.h"
#include "storage/s3/read.h" #include "storage/s3/read.h"
#include "storage/s3/write.h" #include "storage/s3/write.h"

View File

@ -8,10 +8,10 @@ Storage Interface
#include "common/debug.h" #include "common/debug.h"
#include "common/io/io.h" #include "common/io/io.h"
#include "common/type/list.h"
#include "common/log.h" #include "common/log.h"
#include "common/memContext.h" #include "common/memContext.h"
#include "common/regExp.h" #include "common/regExp.h"
#include "common/type/list.h"
#include "common/wait.h" #include "common/wait.h"
#include "storage/storage.h" #include "storage/storage.h"
@ -329,7 +329,8 @@ storageNewItr(const Storage *const this, const String *const pathExp, StorageNew
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN void storageLinkCreate( FN_EXTERN void
storageLinkCreate(
const Storage *const this, const String *const target, const String *const linkPath, const StorageLinkCreateParam param) const Storage *const this, const String *const target, const String *const linkPath, const StorageLinkCreateParam param)
{ {
FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_BEGIN(logLevelDebug);
@ -536,7 +537,8 @@ storagePath(const Storage *this, const String *pathExp, StoragePathParam param)
// Make sure the base storage path is contained within the path expression // Make sure the base storage path is contained within the path expression
if (!strEqZ(this->path, "/")) if (!strEqZ(this->path, "/"))
{ {
if (!param.noEnforce && (!strBeginsWith(pathExp, this->path) || if (!param.noEnforce &&
(!strBeginsWith(pathExp, this->path) ||
!(strSize(pathExp) == strSize(this->path) || *(strZ(pathExp) + strSize(this->path)) == '/'))) !(strSize(pathExp) == strSize(this->path) || *(strZ(pathExp) + strSize(this->path)) == '/')))
{ {
THROW_FMT(AssertError, "absolute path '%s' is not in base path '%s'", strZ(pathExp), strZ(this->path)); THROW_FMT(AssertError, "absolute path '%s' is not in base path '%s'", strZ(pathExp), strZ(this->path));
@ -692,7 +694,8 @@ storagePathRemove(const Storage *this, const String *pathExp, StoragePathRemoveP
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
FN_EXTERN void storagePathSync(const Storage *this, const String *pathExp) FN_EXTERN void
storagePathSync(const Storage *this, const String *pathExp)
{ {
FUNCTION_LOG_BEGIN(logLevelDebug); FUNCTION_LOG_BEGIN(logLevelDebug);
FUNCTION_LOG_PARAM(STORAGE, this); FUNCTION_LOG_PARAM(STORAGE, this);

View File

@ -23,11 +23,11 @@ Object type
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
typedef struct Storage Storage; typedef struct Storage Storage;
#include "common/type/buffer.h"
#include "common/type/stringList.h"
#include "common/io/filter/group.h" #include "common/io/filter/group.h"
#include "common/time.h" #include "common/time.h"
#include "common/type/buffer.h"
#include "common/type/param.h" #include "common/type/param.h"
#include "common/type/stringList.h"
#include "storage/info.h" #include "storage/info.h"
#include "storage/iterator.h" #include "storage/iterator.h"
#include "storage/read.h" #include "storage/read.h"

View File

@ -89,7 +89,6 @@ testBldVmId(const TestBuild *const this)
return THIS_PUB(TestBuild)->vmId; return THIS_PUB(TestBuild)->vmId;
} }
// Test Definition // Test Definition
FN_INLINE_ALWAYS const TestDefModule * FN_INLINE_ALWAYS const TestDefModule *
testBldModule(const TestBuild *const this) testBldModule(const TestBuild *const this)

View File

@ -4,8 +4,8 @@ Parse Define Yaml
#ifndef TEST_COMMAND_TEST_DEFINE_H #ifndef TEST_COMMAND_TEST_DEFINE_H
#define TEST_COMMAND_TEST_DEFINE_H #define TEST_COMMAND_TEST_DEFINE_H
#include "common/type/list.h"
#include "build/common/string.h" #include "build/common/string.h"
#include "common/type/list.h"
#include "storage/storage.h" #include "storage/storage.h"
// Test definition types // Test definition types

View File

@ -14,7 +14,8 @@ Harness for Creating Test Backups
#include "common/harnessTest.h" #include "common/harnessTest.h"
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
void hrnCmdBackup(void) void
hrnCmdBackup(void)
{ {
FUNCTION_HARNESS_VOID(); FUNCTION_HARNESS_VOID();

View File

@ -18,8 +18,8 @@ Harness for Loading Test Configurations
#include "common/harnessConfig.h" #include "common/harnessConfig.h"
#include "common/harnessDebug.h" #include "common/harnessDebug.h"
#include "common/harnessLog.h" #include "common/harnessLog.h"
#include "common/harnessTest.h"
#include "common/harnessStorageHelper.h" #include "common/harnessStorageHelper.h"
#include "common/harnessTest.h"
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
void void

View File

@ -3,8 +3,8 @@ Harness for Loading Test Configurations
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
#include "build.auto.h" #include "build.auto.h"
#include "common/harnessError.h"
#include "common/harnessDebug.h" #include "common/harnessDebug.h"
#include "common/harnessError.h"
#include "common/harnessLog.h" #include "common/harnessLog.h"
#include "common/harnessTest.h" #include "common/harnessTest.h"
@ -14,7 +14,8 @@ Include shimmed C modules
{[SHIM_MODULE]} {[SHIM_MODULE]}
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
void hrnErrorThrow(const HrnErrorThrowParam param) void
hrnErrorThrow(const HrnErrorThrowParam param)
{ {
errorContext.error.errorType = param.errorType != NULL ? param.errorType : &AssertError; errorContext.error.errorType = param.errorType != NULL ? param.errorType : &AssertError;
errorContext.error.fileName = param.fileName != NULL ? param.fileName : "ERR_FILE"; errorContext.error.fileName = param.fileName != NULL ? param.fileName : "ERR_FILE";

View File

@ -4,10 +4,10 @@ Log Test Harness
#include "build.auto.h" #include "build.auto.h"
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h>
#include <regex.h> #include <regex.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <unistd.h>
#include "build/common/regExp.h" #include "build/common/regExp.h"
#include "common/log.h" #include "common/log.h"
@ -95,7 +95,8 @@ hrnLogLevelFile(void)
return logLevelFile; return logLevelFile;
} }
void hrnLogLevelFileSet(unsigned int logLevel) void
hrnLogLevelFileSet(unsigned int logLevel)
{ {
logLevelFile = logLevel; logLevelFile = logLevel;
} }
@ -106,7 +107,8 @@ hrnLogLevelStdOut(void)
return logLevelStdOut; return logLevelStdOut;
} }
void hrnLogLevelStdOutSet(unsigned int logLevel) void
hrnLogLevelStdOutSet(unsigned int logLevel)
{ {
logLevelStdOut = logLevel; logLevelStdOut = logLevel;
} }
@ -117,7 +119,8 @@ hrnLogLevelStdErr(void)
return logLevelStdErr; return logLevelStdErr;
} }
void hrnLogLevelStdErrSet(unsigned int logLevel) void
hrnLogLevelStdErrSet(unsigned int logLevel)
{ {
logLevelStdErr = logLevel; logLevelStdErr = logLevel;
} }
@ -173,7 +176,8 @@ harnessLogLevelDefaultSet(LogLevel logLevel)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
void hrnLogProcessIdSet(unsigned int processId) void
hrnLogProcessIdSet(unsigned int processId)
{ {
logProcessId = processId; logProcessId = processId;
} }

View File

@ -4,8 +4,8 @@ Harness for Manifest Testing
#ifndef TEST_COMMON_HARNESS_MANIFEST_H #ifndef TEST_COMMON_HARNESS_MANIFEST_H
#define TEST_COMMON_HARNESS_MANIFEST_H #define TEST_COMMON_HARNESS_MANIFEST_H
#include "info/manifest.h"
#include "common/user.h" #include "common/user.h"
#include "info/manifest.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Add db to manifest Add db to manifest

View File

@ -12,7 +12,8 @@ Harness for Loading Test Configurations
#include "common/harnessPack.h" #include "common/harnessPack.h"
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
String *hrnPackToStr(const Pack *const pack) String *
hrnPackToStr(const Pack *const pack)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(PACK, pack); FUNCTION_HARNESS_PARAM(PACK, pack);
@ -22,7 +23,8 @@ String *hrnPackToStr(const Pack *const pack)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
String *hrnPackReadToStr(PackRead *read) String *
hrnPackReadToStr(PackRead *read)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(PACK_READ, read); FUNCTION_HARNESS_PARAM(PACK_READ, read);

View File

@ -6,7 +6,6 @@ Macros to create harness functions per PostgreSQL version.
#ifndef TEST_COMMON_HARNESS_POSTGRES_VERSIONINTERN_H #ifndef TEST_COMMON_HARNESS_POSTGRES_VERSIONINTERN_H
#define TEST_COMMON_HARNESS_POSTGRES_VERSIONINTERN_H #define TEST_COMMON_HARNESS_POSTGRES_VERSIONINTERN_H
#include "postgres/version.h"
#include "postgres/interface/version.vendor.h" #include "postgres/interface/version.vendor.h"
#include "common/harnessPostgres.h" #include "common/harnessPostgres.h"

View File

@ -169,7 +169,8 @@ harnessPqScriptRun(const char *const function, const VariantList *const param, c
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Shim for PQconnectdb() Shim for PQconnectdb()
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
PGconn *PQconnectdb(const char *conninfo) PGconn *
PQconnectdb(const char *conninfo)
{ {
return (PGconn *)harnessPqScriptRun(HRNPQ_CONNECTDB, varLstAdd(varLstNew(), varNewStrZ(conninfo)), NULL); return (PGconn *)harnessPqScriptRun(HRNPQ_CONNECTDB, varLstAdd(varLstNew(), varNewStrZ(conninfo)), NULL);
} }
@ -177,7 +178,8 @@ PGconn *PQconnectdb(const char *conninfo)
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Shim for PQstatus() Shim for PQstatus()
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
ConnStatusType PQstatus(const PGconn *conn) ConnStatusType
PQstatus(const PGconn *conn)
{ {
return (ConnStatusType)harnessPqScriptRun(HRNPQ_STATUS, NULL, (HarnessPq *)conn)->resultInt; return (ConnStatusType)harnessPqScriptRun(HRNPQ_STATUS, NULL, (HarnessPq *)conn)->resultInt;
} }
@ -185,7 +187,8 @@ ConnStatusType PQstatus(const PGconn *conn)
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Shim for PQerrorMessage() Shim for PQerrorMessage()
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
char *PQerrorMessage(const PGconn *conn) char *
PQerrorMessage(const PGconn *conn)
{ {
return (char *)harnessPqScriptRun(HRNPQ_ERRORMESSAGE, NULL, (HarnessPq *)conn)->resultZ; return (char *)harnessPqScriptRun(HRNPQ_ERRORMESSAGE, NULL, (HarnessPq *)conn)->resultZ;
} }
@ -359,7 +362,8 @@ PQclear(PGresult *res)
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Shim for PQfinish() Shim for PQfinish()
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
void PQfinish(PGconn *conn) void
PQfinish(PGconn *conn)
{ {
if (harnessPqStrict && !harnessPqScriptFail) if (harnessPqStrict && !harnessPqScriptFail)
harnessPqScriptRun(HRNPQ_FINISH, NULL, (HarnessPq *)conn); harnessPqScriptRun(HRNPQ_FINISH, NULL, (HarnessPq *)conn);

View File

@ -6,9 +6,9 @@ Harness for Protocol Testing
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "common/fork.h"
#include "common/io/fdRead.h" #include "common/io/fdRead.h"
#include "common/io/fdWrite.h" #include "common/io/fdWrite.h"
#include "common/fork.h"
#include "common/harnessConfig.h" #include "common/harnessConfig.h"
#include "common/harnessDebug.h" #include "common/harnessDebug.h"

View File

@ -46,7 +46,8 @@ Constants
#define HRN_SERVER_HOST "tls.test.pgbackrest.org" #define HRN_SERVER_HOST "tls.test.pgbackrest.org"
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
void hrnServerInit(void) void
hrnServerInit(void)
{ {
FUNCTION_HARNESS_VOID(); FUNCTION_HARNESS_VOID();
@ -90,7 +91,8 @@ hrnServerScriptCommand(IoWrite *write, HrnServerCmd cmd, const Variant *data)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
IoWrite *hrnServerScriptBegin(IoWrite *write) IoWrite *
hrnServerScriptBegin(IoWrite *write)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(IO_WRITE, write); FUNCTION_HARNESS_PARAM(IO_WRITE, write);
@ -101,7 +103,8 @@ IoWrite *hrnServerScriptBegin(IoWrite *write)
FUNCTION_HARNESS_RETURN(IO_WRITE, write); FUNCTION_HARNESS_RETURN(IO_WRITE, write);
} }
void hrnServerScriptEnd(IoWrite *write) void
hrnServerScriptEnd(IoWrite *write)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(IO_WRITE, write); FUNCTION_HARNESS_PARAM(IO_WRITE, write);
@ -227,7 +230,8 @@ hrnServerScriptSleep(IoWrite *write, TimeMSec sleepMs)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
void hrnServerRun(IoRead *read, HrnServerProtocol protocol, HrnServerRunParam param) void
hrnServerRun(IoRead *read, HrnServerProtocol protocol, HrnServerRunParam param)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(IO_READ, read); FUNCTION_HARNESS_PARAM(IO_READ, read);
@ -366,13 +370,15 @@ void hrnServerRun(IoRead *read, HrnServerProtocol protocol, HrnServerRunParam pa
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
const String *hrnServerHost(void) const String *
hrnServerHost(void)
{ {
return strNewZ(testContainer() ? HRN_SERVER_HOST : "127.0.0.1"); return strNewZ(testContainer() ? HRN_SERVER_HOST : "127.0.0.1");
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
unsigned int hrnServerPort(unsigned int portIdx) unsigned int
hrnServerPort(unsigned int portIdx)
{ {
ASSERT(portIdx < HRN_SERVER_PORT_MAX); ASSERT(portIdx < HRN_SERVER_PORT_MAX);

View File

@ -26,37 +26,63 @@ Dummy functions and interface for constructing test storage drivers
static StorageInfo static StorageInfo
storageTestDummyInfo(THIS_VOID, const String *file, StorageInfoLevel level, StorageInterfaceInfoParam param) storageTestDummyInfo(THIS_VOID, const String *file, StorageInfoLevel level, StorageInterfaceInfoParam param)
{ {
(void)thisVoid; (void)file; (void)level; (void)param; return (StorageInfo){.exists = false}; (void)thisVoid;
(void)file;
(void)level;
(void)param;
return (StorageInfo){.exists = false};
} }
static StorageList * static StorageList *
storageTestDummyList(THIS_VOID, const String *path, StorageInfoLevel level, StorageInterfaceListParam param) storageTestDummyList(THIS_VOID, const String *path, StorageInfoLevel level, StorageInterfaceListParam param)
{ {
(void)thisVoid; (void)path; (void)level; (void)param; return false; (void)thisVoid;
(void)path;
(void)level;
(void)param;
return false;
} }
static StorageRead * static StorageRead *
storageTestDummyNewRead(THIS_VOID, const String *file, bool ignoreMissing, StorageInterfaceNewReadParam param) storageTestDummyNewRead(THIS_VOID, const String *file, bool ignoreMissing, StorageInterfaceNewReadParam param)
{ {
(void)thisVoid; (void)file; (void)ignoreMissing; (void)param; return NULL; (void)thisVoid;
(void)file;
(void)ignoreMissing;
(void)param;
return NULL;
} }
static StorageWrite * static StorageWrite *
storageTestDummyNewWrite(THIS_VOID, const String *file, StorageInterfaceNewWriteParam param) storageTestDummyNewWrite(THIS_VOID, const String *file, StorageInterfaceNewWriteParam param)
{ {
(void)thisVoid; (void)file; (void)param; return NULL; (void)thisVoid;
(void)file;
(void)param;
return NULL;
} }
static bool static bool
storageTestDummyPathRemove(THIS_VOID, const String *path, bool recurse, StorageInterfacePathRemoveParam param) storageTestDummyPathRemove(THIS_VOID, const String *path, bool recurse, StorageInterfacePathRemoveParam param)
{ {
(void)thisVoid; (void)path; (void)recurse; (void)param; return false; (void)thisVoid;
(void)path;
(void)recurse;
(void)param;
return false;
} }
static void static void
storageTestDummyRemove(THIS_VOID, const String *file, StorageInterfaceRemoveParam param) storageTestDummyRemove(THIS_VOID, const String *file, StorageInterfaceRemoveParam param)
{ {
(void)thisVoid; (void)file; (void)param; (void)thisVoid;
(void)file;
(void)param;
} }
const StorageInterface storageInterfaceTestDummy = const StorageInterface storageInterfaceTestDummy =

View File

@ -11,8 +11,8 @@ C Test Harness
#include <unistd.h> #include <unistd.h>
#include "common/harnessDebug.h" #include "common/harnessDebug.h"
#include "common/harnessTest.h"
#include "common/harnessLog.h" #include "common/harnessLog.h"
#include "common/harnessTest.h"
#define TEST_LIST_SIZE 64 #define TEST_LIST_SIZE 64
@ -442,7 +442,8 @@ hrnTestResultEnd(void)
} }
/**********************************************************************************************************************************/ /**********************************************************************************************************************************/
static void hrnTestResultDiff(const char *actual, const char *expected) static void
hrnTestResultDiff(const char *actual, const char *expected)
{ {
if (actual != NULL && expected != NULL && (strstr(actual, "\n") != NULL || strstr(expected, "\n") != NULL)) if (actual != NULL && expected != NULL && (strstr(actual, "\n") != NULL || strstr(expected, "\n") != NULL))
{ {

Some files were not shown because too many files have changed in this diff Show More