You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-29 08:21:11 +03:00
Fix formatting errors.
Errors in our current (manually-maintained) code format discovered by uncrustify.
This commit is contained in:
@ -165,7 +165,6 @@ yamlEventPeek(Yaml *const this)
|
||||
FUNCTION_TEST_RETURN_TYPE(YamlEvent, this->eventNext);
|
||||
}
|
||||
|
||||
|
||||
YamlEvent
|
||||
yamlEventNext(Yaml *this)
|
||||
{
|
||||
|
@ -12,8 +12,8 @@ Yaml object
|
||||
typedef struct Yaml Yaml;
|
||||
|
||||
#include "common/memContext.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/buffer.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/stringId.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -10,12 +10,12 @@ Annotate Command
|
||||
|
||||
#include "command/annotate/annotate.h"
|
||||
#include "command/backup/backup.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "common/regExp.h"
|
||||
#include "config/config.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "info/infoBackup.h"
|
||||
#include "storage/helper.h"
|
||||
|
||||
|
@ -301,7 +301,7 @@ archiveIdComparator(const void *item1, const void *item2)
|
||||
int int1 = atoi(strZ(strLstGet(archiveSort1, 1)));
|
||||
int int2 = atoi(strZ(strLstGet(archiveSort2, 1)));
|
||||
|
||||
return (int1 - int2);
|
||||
return int1 - int2;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
|
@ -3,8 +3,8 @@ Archive Get File
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "command/archive/get/file.h"
|
||||
#include "command/archive/common.h"
|
||||
#include "command/archive/get/file.h"
|
||||
#include "command/control/common.h"
|
||||
#include "common/compress/helper.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
|
@ -218,9 +218,10 @@ archiveGetFind(
|
||||
}
|
||||
}
|
||||
// Else if not a WAL segment, see if it exists in the archiveId path
|
||||
else if (storageExistsP(
|
||||
storageRepoIdx(cacheRepo->repoIdx), strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(cacheArchive->archiveId),
|
||||
strZ(archiveFileRequest))))
|
||||
else if (
|
||||
storageExistsP(
|
||||
storageRepoIdx(cacheRepo->repoIdx),
|
||||
strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(cacheArchive->archiveId), strZ(archiveFileRequest))))
|
||||
{
|
||||
MEM_CONTEXT_BEGIN(lstMemContext(getCheckResult->archiveFileMapList))
|
||||
{
|
||||
@ -264,7 +265,6 @@ archiveGetFind(
|
||||
getCheckResult->warnList = strLstMove(fileWarnList, memContextCurrent());
|
||||
}
|
||||
MEM_CONTEXT_END();
|
||||
|
||||
}
|
||||
// Else if a file was found
|
||||
else if (!lstEmpty(matchList))
|
||||
|
@ -3,8 +3,8 @@ Archive Push File
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "command/archive/push/file.h"
|
||||
#include "command/archive/common.h"
|
||||
#include "command/archive/push/file.h"
|
||||
#include "command/control/common.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/crypto/hash.h"
|
||||
|
@ -17,8 +17,8 @@ Archive Push Command
|
||||
#include "common/memContext.h"
|
||||
#include "common/wait.h"
|
||||
#include "config/config.h"
|
||||
#include "config/load.h"
|
||||
#include "config/exec.h"
|
||||
#include "config/load.h"
|
||||
#include "info/infoArchive.h"
|
||||
#include "postgres/interface.h"
|
||||
#include "postgres/version.h"
|
||||
|
@ -9,15 +9,15 @@ Backup Command
|
||||
#include <unistd.h>
|
||||
|
||||
#include "command/archive/common.h"
|
||||
#include "command/control/common.h"
|
||||
#include "command/backup/backup.h"
|
||||
#include "command/backup/common.h"
|
||||
#include "command/backup/file.h"
|
||||
#include "command/backup/protocol.h"
|
||||
#include "command/check/common.h"
|
||||
#include "command/control/common.h"
|
||||
#include "command/stanza/common.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/compress/helper.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/size.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
|
||||
static ProtocolParallelJob *backupJobCallback(void *data, unsigned int clientIdx)
|
||||
static ProtocolParallelJob *
|
||||
backupJobCallback(void *data, unsigned int clientIdx)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM_P(VOID, data);
|
||||
|
@ -16,8 +16,8 @@ Block Incremental Filter
|
||||
#include "common/io/filter/size.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/pack.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/pack.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Object type
|
||||
|
@ -28,9 +28,9 @@ The block map is terminated by a varint-128 encoded zero stop byte.
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "command/backup/blockMap.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "command/backup/blockMap.h"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
typedef struct BlockMapRef
|
||||
|
@ -245,8 +245,7 @@ backupFile(
|
||||
|
||||
// Add block incremental filter
|
||||
ioFilterGroupAdd(
|
||||
ioReadFilterGroup(
|
||||
storageReadIo(read)),
|
||||
ioReadFilterGroup(storageReadIo(read)),
|
||||
blockIncrNew(
|
||||
(size_t)file->blockIncrSize, blockIncrReference, bundleId, bundleOffset, blockMap, compress,
|
||||
encrypt));
|
||||
|
@ -3,9 +3,9 @@ Page Checksum Filter
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "command/backup/pageChecksum.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/filter.h"
|
||||
#include "command/backup/pageChecksum.h"
|
||||
#include "common/log.h"
|
||||
#include "common/macro.h"
|
||||
#include "common/type/json.h"
|
||||
|
@ -154,9 +154,12 @@ checkPrimary(const DbGetResult dbGroup)
|
||||
storageRepo, repoArchiveId[repoIdx], walSegment, cfgOptionUInt64(cfgOptArchiveTimeout));
|
||||
|
||||
LOG_INFO_FMT(
|
||||
"WAL segment %s successfully archived to '%s' on %s", strZ(walSegment),
|
||||
strZ(storagePathP(storageRepo, strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(repoArchiveId[repoIdx]),
|
||||
strZ(walSegmentFile)))), cfgOptionGroupName(cfgOptGrpRepo, repoIdx));
|
||||
"WAL segment %s successfully archived to '%s' on %s",
|
||||
strZ(walSegment),
|
||||
strZ(
|
||||
storagePathP(
|
||||
storageRepo, strNewFmt(STORAGE_REPO_ARCHIVE "/%s/%s", strZ(repoArchiveId[repoIdx]), strZ(walSegmentFile)))),
|
||||
cfgOptionGroupName(cfgOptGrpRepo, repoIdx));
|
||||
}
|
||||
|
||||
dbFree(dbGroup.primary);
|
||||
|
@ -151,7 +151,9 @@ checkStanzaInfoPg(
|
||||
// Check that the version and system id match the current database
|
||||
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: did an error occur during stanza-upgrade?");
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ Exit Routines
|
||||
#ifndef COMMAND_EXIT_H
|
||||
#define COMMAND_EXIT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <signal.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Signal type
|
||||
|
@ -6,10 +6,10 @@ Expire Command
|
||||
#include "command/archive/common.h"
|
||||
#include "command/backup/common.h"
|
||||
#include "command/control/common.h"
|
||||
#include "common/time.h"
|
||||
#include "common/type/list.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/regExp.h"
|
||||
#include "common/time.h"
|
||||
#include "common/type/list.h"
|
||||
#include "config/config.h"
|
||||
#include "info/infoArchive.h"
|
||||
#include "info/infoBackup.h"
|
||||
@ -717,6 +717,7 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
|
||||
// Track that this archive was removed
|
||||
archiveExpire.total++;
|
||||
archiveExpire.stop = strDup(strSubN(walSubPath, 0, 24));
|
||||
|
||||
if (archiveExpire.start == NULL)
|
||||
archiveExpire.start = strDup(strSubN(walSubPath, 0, 24));
|
||||
}
|
||||
@ -746,7 +747,6 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
|
||||
.expression = WAL_TIMELINE_HISTORY_REGEXP_STR),
|
||||
sortOrderAsc);
|
||||
|
||||
|
||||
for (unsigned int historyFileIdx = 0; historyFileIdx < strLstSize(historyFilesList); historyFileIdx++)
|
||||
{
|
||||
String *historyFile = strLstGet(historyFilesList, historyFileIdx);
|
||||
@ -767,7 +767,6 @@ removeExpiredArchive(InfoBackup *infoBackup, bool timeBasedFullRetention, unsign
|
||||
strZ(archiveId), strZ(historyFile));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -532,8 +532,9 @@ backupListAdd(
|
||||
{
|
||||
kvPut(varKv(link), KEY_NAME_VAR, varNewStr(target->file));
|
||||
kvPut(
|
||||
varKv(link), KEY_DESTINATION_VAR, varNewStr(strNewFmt("%s/%s", strZ(target->path),
|
||||
strZ(target->file))));
|
||||
varKv(link), KEY_DESTINATION_VAR,
|
||||
varNewStr(strNewFmt("%s/%s", strZ(target->path), strZ(target->file))));
|
||||
|
||||
varLstAdd(linkSection, link);
|
||||
}
|
||||
else
|
||||
@ -1552,7 +1553,6 @@ infoRender(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
strCatFmt(
|
||||
resultStr, INFO_STANZA_STATUS_ERROR " (%s)\n",
|
||||
strZ(varStr(kvGet(repoStatus, STATUS_KEY_MESSAGE_VAR))));
|
||||
|
@ -8,9 +8,9 @@ Repository Create Command
|
||||
#include "common/memContext.h"
|
||||
#include "common/type/json.h"
|
||||
#include "config/config.h"
|
||||
#include "storage/helper.h"
|
||||
#include "storage/azure/storage.intern.h"
|
||||
#include "storage/gcs/storage.intern.h"
|
||||
#include "storage/helper.h"
|
||||
#include "storage/s3/storage.intern.h"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
|
@ -121,8 +121,11 @@ storageGetProcess(IoWrite *destination)
|
||||
!strEndsWithZ(file, BACKUP_MANIFEST_FILE INFO_COPY_EXT))
|
||||
{
|
||||
const Manifest *manifest = manifestLoadFile(
|
||||
storageRepo(), strNewFmt(STORAGE_PATH_BACKUP "/%s/%s/%s", strZ(stanza),
|
||||
strZ(strLstGet(filePathSplitLst, 2)), BACKUP_MANIFEST_FILE), repoCipherType, cipherPass);
|
||||
storageRepo(),
|
||||
strNewFmt(
|
||||
STORAGE_PATH_BACKUP "/%s/%s/%s", strZ(stanza), strZ(strLstGet(filePathSplitLst, 2)),
|
||||
BACKUP_MANIFEST_FILE),
|
||||
repoCipherType, cipherPass);
|
||||
cipherPass = manifestCipherSubPass(manifest);
|
||||
}
|
||||
}
|
||||
|
@ -347,7 +347,8 @@ restoreBackupSet(void)
|
||||
|
||||
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"
|
||||
"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 "
|
||||
@ -2193,7 +2194,6 @@ restoreJobResult(const Manifest *manifest, ProtocolParallelJob *job, RegExp *zer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add bundle info
|
||||
strCatZ(log, " (");
|
||||
|
||||
@ -2269,7 +2269,8 @@ restoreJobQueueNext(unsigned int clientIdx, int queueIdx, unsigned int queueTota
|
||||
}
|
||||
|
||||
// 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_PARAM_P(VOID, data);
|
||||
|
@ -5,8 +5,8 @@ Server Ping Command
|
||||
|
||||
#include "command/server/ping.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/tls/client.h"
|
||||
#include "common/io/socket/client.h"
|
||||
#include "common/io/tls/client.h"
|
||||
#include "config/config.h"
|
||||
#include "protocol/client.h"
|
||||
#include "protocol/helper.h"
|
||||
|
@ -3,9 +3,9 @@ Stanza Create Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "command/check/common.h"
|
||||
#include "command/control/common.h"
|
||||
@ -145,8 +145,8 @@ cmdStanzaCreate(void)
|
||||
FileMissingError,
|
||||
"%s on %s\n"
|
||||
"HINT: this may be a symptom of repository corruption!",
|
||||
((archiveInfoFileExists || archiveInfoFileCopyExists) ?
|
||||
"archive.info exists but backup.info is missing" : "backup.info exists but archive.info is missing"),
|
||||
(archiveInfoFileExists || archiveInfoFileCopyExists) ?
|
||||
"archive.info exists but backup.info is missing" : "backup.info exists but archive.info is missing",
|
||||
cfgOptionGroupName(cfgOptGrpRepo, repoIdx));
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ Stanza Delete Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "command/backup/common.h"
|
||||
#include "command/control/common.h"
|
||||
#include "command/stanza/delete.h"
|
||||
#include "command/backup/common.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/memContext.h"
|
||||
#include "config/config.h"
|
||||
|
@ -3,9 +3,9 @@ Stanza Update Command
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "command/check/common.h"
|
||||
#include "command/control/common.h"
|
||||
|
@ -1341,6 +1341,7 @@ verifyRender(const List *const archiveIdResultList, const List *const backupResu
|
||||
for (unsigned int archiveIdx = 0; archiveIdx < lstSize(archiveIdResultList); archiveIdx++)
|
||||
{
|
||||
VerifyArchiveResult *archiveIdResult = lstGet(archiveIdResultList, archiveIdx);
|
||||
|
||||
if (verboseText || archiveIdResult->totalWalFile - archiveIdResult->totalValidWal != 0)
|
||||
{
|
||||
strCatFmt(
|
||||
@ -1631,8 +1632,8 @@ verifyProcess(const bool verboseText)
|
||||
// Add invalid file to the WAL range
|
||||
verifyAddInvalidWalFile(
|
||||
archiveIdResult->walRangeList, verifyResult, filePathName,
|
||||
strSubN(strLstGet(filePathLst, strLstSize(filePathLst) - 1), 0,
|
||||
WAL_SEGMENT_NAME_SIZE));
|
||||
strSubN(
|
||||
strLstGet(filePathLst, strLstSize(filePathLst) - 1), 0, WAL_SEGMENT_NAME_SIZE));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3,8 +3,8 @@ BZ2 Compress
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <bzlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "common/compress/bz2/common.h"
|
||||
#include "common/compress/bz2/compress.h"
|
||||
|
@ -3,8 +3,8 @@ BZ2 Decompress
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <bzlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "common/compress/bz2/common.h"
|
||||
#include "common/compress/bz2/decompress.h"
|
||||
|
@ -5,13 +5,13 @@ Compression Helper
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "common/compress/helper.h"
|
||||
#include "common/compress/bz2/common.h"
|
||||
#include "common/compress/bz2/compress.h"
|
||||
#include "common/compress/bz2/decompress.h"
|
||||
#include "common/compress/gz/common.h"
|
||||
#include "common/compress/gz/compress.h"
|
||||
#include "common/compress/gz/decompress.h"
|
||||
#include "common/compress/helper.h"
|
||||
#include "common/compress/lz4/common.h"
|
||||
#include "common/compress/lz4/compress.h"
|
||||
#include "common/compress/lz4/decompress.h"
|
||||
|
@ -26,8 +26,8 @@ typedef enum
|
||||
compressTypeXz, // xz/lzma
|
||||
} CompressType;
|
||||
|
||||
#include <common/type/stringId.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
|
||||
|
@ -7,8 +7,8 @@ Developed against version r131 using the documentation in https://github.com/lz4
|
||||
|
||||
#ifdef HAVE_LIBLZ4
|
||||
|
||||
#include <stdio.h>
|
||||
#include <lz4frame.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common/compress/lz4/common.h"
|
||||
|
@ -5,8 +5,8 @@ LZ4 Decompress
|
||||
|
||||
#ifdef HAVE_LIBLZ4
|
||||
|
||||
#include <stdio.h>
|
||||
#include <lz4frame.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "common/compress/lz4/common.h"
|
||||
#include "common/compress/lz4/decompress.h"
|
||||
|
@ -5,8 +5,8 @@ Block Cipher
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/crypto/common.h"
|
||||
@ -196,8 +196,7 @@ cipherBlockProcessBlock(CipherBlock *this, const unsigned char *source, size_t s
|
||||
|
||||
// Initialize cipher
|
||||
cryptoError(
|
||||
!EVP_CipherInit_ex(
|
||||
this->cipherContext, this->cipher, NULL, key, initVector, this->mode == cipherModeEncrypt),
|
||||
!EVP_CipherInit_ex(this->cipherContext, this->cipher, NULL, key, initVector, this->mode == cipherModeEncrypt),
|
||||
"unable to initialize cipher");
|
||||
|
||||
this->saltDone = true;
|
||||
|
@ -4,8 +4,8 @@ Block Cipher Header
|
||||
#ifndef COMMON_CRYPTO_CIPHERBLOCK_H
|
||||
#define COMMON_CRYPTO_CIPHERBLOCK_H
|
||||
|
||||
#include "common/io/filter/group.h"
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/io/filter/group.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Filter type constant
|
||||
|
@ -9,10 +9,10 @@ Crypto Common
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/error.h"
|
||||
#include "common/log.h"
|
||||
#include "common/crypto/common.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Flag to indicate if OpenSSL has already been initialized
|
||||
|
@ -5,17 +5,17 @@ Cryptographic Hash
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/hmac.h>
|
||||
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/crypto/hash.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/filter.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/pack.h"
|
||||
#include "common/crypto/common.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Hashes for zero-length files (i.e., seed value)
|
||||
|
@ -8,7 +8,8 @@ Debug Routines
|
||||
#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);
|
||||
|
||||
|
@ -6,8 +6,8 @@ Binary to String Encode/Decode
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common/encode.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/encode.h"
|
||||
#include "common/error.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
@ -181,14 +181,16 @@ decodeToBinBase64(const char *source, unsigned char *destination)
|
||||
// Second character is optional
|
||||
if (source[sourceIdx + 2] != 0x3d)
|
||||
{
|
||||
destination[destinationIdx++] = (unsigned char)
|
||||
(decodeBase64Lookup[(int)source[sourceIdx + 1]] << 4 | decodeBase64Lookup[(int)source[sourceIdx + 2]] >> 2);
|
||||
destination[destinationIdx++] =
|
||||
(unsigned char)
|
||||
((decodeBase64Lookup[(int)source[sourceIdx + 1]] << 4) | (decodeBase64Lookup[(int)source[sourceIdx + 2]] >> 2));
|
||||
}
|
||||
|
||||
// Third character is optional
|
||||
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]]);
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,8 @@ static char messageBufferTemp[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);
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -434,6 +436,7 @@ errorInternalThrowSys(
|
||||
}
|
||||
|
||||
#ifdef DEBUG_COVERAGE
|
||||
|
||||
FN_EXTERN void
|
||||
errorInternalThrowOnSys(
|
||||
bool error, int errNo, const ErrorType *errorType, const char *fileName, const char *functionName, int fileLine,
|
||||
@ -442,6 +445,7 @@ errorInternalThrowOnSys(
|
||||
if (error)
|
||||
errorInternalThrowSys(errNo, errorType, fileName, functionName, fileLine, message);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
FN_EXTERN void
|
||||
@ -462,6 +466,7 @@ errorInternalThrowSysFmt(
|
||||
}
|
||||
|
||||
#ifdef DEBUG_COVERAGE
|
||||
|
||||
FN_EXTERN void
|
||||
errorInternalThrowOnSysFmt(
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -11,7 +11,6 @@ Execute Process
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/exec.h"
|
||||
#include "common/fork.h"
|
||||
#include "common/io/fdRead.h"
|
||||
@ -19,6 +18,7 @@ Execute Process
|
||||
#include "common/io/io.h"
|
||||
#include "common/io/read.h"
|
||||
#include "common/io/write.h"
|
||||
#include "common/log.h"
|
||||
#include "common/wait.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -8,8 +8,8 @@ Ini Handler
|
||||
#include <string.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/ini.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/json.h"
|
||||
#include "common/type/keyValue.h"
|
||||
|
||||
|
@ -11,8 +11,8 @@ Object type
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct HttpSession HttpSession;
|
||||
|
||||
#include "common/io/read.h"
|
||||
#include "common/io/http/client.h"
|
||||
#include "common/io/read.h"
|
||||
#include "common/io/session.h"
|
||||
#include "common/io/write.h"
|
||||
#include "common/type/object.h"
|
||||
|
@ -5,8 +5,8 @@ HTTP URL
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/io/http/url.h"
|
||||
#include "common/type/stringList.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.
|
||||
|
@ -11,8 +11,8 @@ Object type
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct HttpUrl HttpUrl;
|
||||
|
||||
#include "common/type/param.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/param.h"
|
||||
#include "common/type/string.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -4,16 +4,16 @@ Socket Client
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/io/client.h"
|
||||
#include "common/io/socket/client.h"
|
||||
#include "common/io/socket/common.h"
|
||||
#include "common/io/socket/session.h"
|
||||
#include "common/log.h"
|
||||
#include "common/stat.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/wait.h"
|
||||
|
@ -4,16 +4,16 @@ Socket Server
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/io/server.h"
|
||||
#include "common/io/socket/server.h"
|
||||
#include "common/io/socket/common.h"
|
||||
#include "common/io/socket/server.h"
|
||||
#include "common/io/socket/session.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "common/stat.h"
|
||||
#include "common/type/object.h"
|
||||
|
@ -6,11 +6,11 @@ Socket Session
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/io/fdRead.h"
|
||||
#include "common/io/fdWrite.h"
|
||||
#include "common/io/socket/client.h"
|
||||
#include "common/io/session.h"
|
||||
#include "common/io/socket/client.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/object.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -7,12 +7,12 @@ TLS Client
|
||||
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/io/client.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/io/tls/client.h"
|
||||
#include "common/io/tls/common.h"
|
||||
#include "common/io/tls/session.h"
|
||||
#include "common/log.h"
|
||||
#include "common/stat.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/wait.h"
|
||||
|
@ -79,8 +79,10 @@ tlsCertCommonName(X509 *const certificate)
|
||||
static int
|
||||
tlsCertPwd(char *buffer, const int size, const int rwFlag, void *const userData)
|
||||
{
|
||||
(void)rwFlag;
|
||||
(void)userData;
|
||||
|
||||
CHECK(ServiceError, size > 0, "buffer has zero size");
|
||||
(void)rwFlag; (void)userData;
|
||||
|
||||
// No password is currently supplied
|
||||
buffer[0] = '\0';
|
||||
|
@ -4,19 +4,19 @@ TLS Server
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/io/server.h"
|
||||
#include "common/io/tls/common.h"
|
||||
#include "common/io/tls/server.h"
|
||||
#include "common/io/tls/session.h"
|
||||
#include "common/log.h"
|
||||
#include "common/stat.h"
|
||||
#include "common/type/object.h"
|
||||
|
||||
@ -309,7 +309,8 @@ tlsServerNew(
|
||||
memContextCallbackSet(objMemContext(driver), tlsServerFreeResource, driver);
|
||||
|
||||
// Set options
|
||||
SSL_CTX_set_options(driver->context,
|
||||
SSL_CTX_set_options(
|
||||
driver->context,
|
||||
// Disable SSL and TLS v1/v1.1
|
||||
SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 |
|
||||
// Let server set cipher order
|
||||
|
@ -177,7 +177,8 @@ static MemContextCallbackOne *
|
||||
memContextCallbackOne(MemContext *const memContext)
|
||||
{
|
||||
return
|
||||
(MemContextCallbackOne *)((unsigned char *)(memContext + 1) +
|
||||
(MemContextCallbackOne *)
|
||||
((unsigned char *)(memContext + 1) +
|
||||
memContextSizePossible[memContext->childQty][memContext->allocQty][0] + memContext->allocExtra);
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ Stack Trace Handler
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LIBBACKTRACE
|
||||
#include <backtrace.h>
|
||||
#include <backtrace-supported.h>
|
||||
#include <backtrace.h>
|
||||
#endif
|
||||
|
||||
#include "common/assert.h"
|
||||
|
@ -84,5 +84,4 @@ blbAdd(Blob *const this, const void *const data, const size_t size)
|
||||
MEM_CONTEXT_OBJ_END();
|
||||
|
||||
FUNCTION_TEST_RETURN_P(VOID, result);
|
||||
|
||||
}
|
||||
|
@ -349,6 +349,6 @@ FN_EXTERN void
|
||||
bufToLog(const Buffer *const this, StringStatic *const debugLog)
|
||||
{
|
||||
strStcFmt(
|
||||
debugLog, "{used: %zu, size: %zu%s", bufUsed(this), bufSize(this), bufSizeLimit(this) ? zNewFmt(", sizeAlloc: %zu}",
|
||||
bufSizeAlloc(this)) : "}");
|
||||
debugLog, "{used: %zu, size: %zu%s", bufUsed(this), bufSize(this),
|
||||
bufSizeLimit(this) ? zNewFmt(", sizeAlloc: %zu}", bufSizeAlloc(this)) : "}");
|
||||
}
|
||||
|
@ -572,7 +572,7 @@ jsonReadKeyZN(JsonRead *const this)
|
||||
THROW(JsonFormatError, "expected '\"' but found null delimiter");
|
||||
|
||||
this->json++;
|
||||
};
|
||||
}
|
||||
|
||||
// Set key size
|
||||
result.size = (size_t)(this->json - result.buffer);
|
||||
@ -845,7 +845,7 @@ jsonReadSkipStr(JsonRead *const this)
|
||||
THROW(JsonFormatError, "expected '\"' but found null delimiter");
|
||||
|
||||
this->json++;
|
||||
};
|
||||
}
|
||||
|
||||
// Advance the character array pointer to the next element after the string
|
||||
this->json++;
|
||||
|
@ -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_PARAM(DOUBLE, value);
|
||||
|
@ -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.
|
||||
***********************************************************************************************************************************/
|
||||
static void xmlErrorHandler(void *ctx, const char *format, ...)
|
||||
static void
|
||||
xmlErrorHandler(void *ctx, const char *format, ...)
|
||||
{
|
||||
(void)ctx;
|
||||
(void)format;
|
||||
|
@ -460,7 +460,6 @@ cfgOptionDefaultSet(ConfigOption optionId, const Variant *defaultValue)
|
||||
FUNCTION_TEST_RETURN_VOID();
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
FN_EXTERN const String *
|
||||
cfgOptionDisplayVar(const Variant *const value, const ConfigOptionType optionType)
|
||||
@ -524,7 +523,6 @@ cfgOptionIdxDisplay(const ConfigOption optionId, const unsigned int optionIdx)
|
||||
}
|
||||
MEM_CONTEXT_END();
|
||||
|
||||
|
||||
FUNCTION_TEST_RETURN_CONST(STRING, option->display);
|
||||
}
|
||||
|
||||
|
@ -10,19 +10,19 @@ Configuration Load
|
||||
#include "command/command.h"
|
||||
#include "common/compress/helper.intern.h"
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/memContext.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/io/socket/common.h"
|
||||
#include "common/lock.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "config/config.intern.h"
|
||||
#include "config/load.h"
|
||||
#include "config/parse.h"
|
||||
#include "info/infoBackup.h"
|
||||
#include "storage/cifs/storage.h"
|
||||
#include "storage/posix/storage.h"
|
||||
#include "storage/helper.h"
|
||||
#include "storage/posix/storage.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Load log settings
|
||||
@ -219,11 +219,11 @@ cfgLoadUpdateOption(void)
|
||||
{
|
||||
case backupTypeFull:
|
||||
{
|
||||
if (cfgOptionIdxStrId(cfgOptRepoRetentionFullType, optionIdx) ==
|
||||
CFGOPTVAL_REPO_RETENTION_FULL_TYPE_COUNT &&
|
||||
if (cfgOptionIdxStrId(cfgOptRepoRetentionFullType, optionIdx) == CFGOPTVAL_REPO_RETENTION_FULL_TYPE_COUNT &&
|
||||
cfgOptionIdxTest(cfgOptRepoRetentionFull, optionIdx))
|
||||
{
|
||||
cfgOptionIdxSet(cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault,
|
||||
cfgOptionIdxSet(
|
||||
cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault,
|
||||
VARINT64(cfgOptionIdxInt64(cfgOptRepoRetentionFull, optionIdx)));
|
||||
}
|
||||
|
||||
@ -235,7 +235,8 @@ cfgLoadUpdateOption(void)
|
||||
// if repo-retention-diff is set then user must have set it
|
||||
if (cfgOptionIdxTest(cfgOptRepoRetentionDiff, optionIdx))
|
||||
{
|
||||
cfgOptionIdxSet(cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault,
|
||||
cfgOptionIdxSet(
|
||||
cfgOptRepoRetentionArchive, optionIdx, cfgSourceDefault,
|
||||
VARINT64(cfgOptionIdxInt64(cfgOptRepoRetentionDiff, optionIdx)));
|
||||
}
|
||||
else
|
||||
|
@ -1252,9 +1252,10 @@ cfgFileLoadPart(String **config, const Buffer *configPart)
|
||||
}
|
||||
|
||||
static String *
|
||||
cfgFileLoad( // NOTE: Passing defaults to enable more complete test coverage
|
||||
cfgFileLoad(
|
||||
const Storage *storage, // Storage to load configs
|
||||
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 *optConfigIncludePathDefault, // Current default for --config-include-path option
|
||||
const String *origConfigDefault) // Original --config option default (/etc/pgbackrest.conf)
|
||||
|
@ -618,7 +618,6 @@ dbReplayWait(Db *const this, const String *const targetLsn, const uint32_t targe
|
||||
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
|
||||
// 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.
|
||||
if (dbPgControl(this).checkpoint > pgLsnFromStr(targetLsn))
|
||||
|
@ -7,12 +7,12 @@ Info Handler
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common/type/convert.h"
|
||||
#include "common/crypto/hash.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/io/filter/filter.h"
|
||||
#include "common/ini.h"
|
||||
#include "common/io/filter/filter.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/convert.h"
|
||||
#include "common/type/json.h"
|
||||
#include "common/type/object.h"
|
||||
#include "info/info.h"
|
||||
|
@ -3,17 +3,17 @@ Archive Info Handler
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/ini.h"
|
||||
#include "common/io/bufferWrite.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/log.h"
|
||||
#include "info/infoArchive.h"
|
||||
#include "info/infoPg.h"
|
||||
#include "postgres/interface.h"
|
||||
|
@ -3,10 +3,10 @@ Backup Info Handler
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "command/backup/common.h"
|
||||
#include "common/crypto/cipherBlock.h"
|
||||
@ -150,7 +150,6 @@ infoBackupLoadCallback(void *data, const String *section, const String *key, con
|
||||
InfoBackupData info =
|
||||
{
|
||||
.backupLabel = strDup(key),
|
||||
|
||||
};
|
||||
|
||||
// Format and version
|
||||
|
@ -6,8 +6,8 @@ PostgreSQL Info Handler
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
|
@ -125,5 +125,4 @@ FN_EXTERN void infoPgDataToLog(const InfoPgData *this, StringStatic *debugLog);
|
||||
#define FUNCTION_LOG_INFO_PG_DATA_FORMAT(value, buffer, bufferSize) \
|
||||
FUNCTION_LOG_OBJECT_FORMAT(&value, infoPgDataToLog, buffer, bufferSize)
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1528,7 +1528,8 @@ manifestBuildValidate(Manifest *this, bool delta, time_t copyStart, CompressType
|
||||
{
|
||||
LOG_WARN_FMT(
|
||||
"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;
|
||||
break;
|
||||
@ -1744,7 +1745,6 @@ manifestBuildComplete(
|
||||
pckReadArrayEndP(read);
|
||||
|
||||
manifestDbAdd(this, &(ManifestDb){.id = id, .name = name, .lastSystemId = lastSystemId});
|
||||
|
||||
}
|
||||
|
||||
lstSort(this->pub.dbList, sortOrderAsc);
|
||||
@ -2051,7 +2051,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
|
||||
|
||||
manifestFileAdd(manifest, &file);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
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);
|
||||
manifestPathAdd(manifest, &path);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
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);
|
||||
manifestLinkAdd(manifest, &link);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
else if (strEqZ(section, MANIFEST_SECTION_BACKUP_TARGET))
|
||||
{
|
||||
@ -2186,7 +2180,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
|
||||
|
||||
manifestTargetAdd(manifest, &target);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
else if (strEqZ(section, MANIFEST_SECTION_DB))
|
||||
{
|
||||
@ -2203,7 +2196,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
|
||||
|
||||
manifestDbAdd(manifest, &db);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
else if (strEqZ(section, MANIFEST_SECTION_METADATA))
|
||||
{
|
||||
@ -2214,7 +2206,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
|
||||
}
|
||||
MEM_CONTEXT_END();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
else if (strEqZ(section, MANIFEST_SECTION_BACKUP))
|
||||
{
|
||||
@ -2257,7 +2248,6 @@ manifestLoadCallback(void *callbackData, const String *const section, const Stri
|
||||
}
|
||||
MEM_CONTEXT_END();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
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))
|
||||
manifest->pub.data.pgVersion = pgVersionFromStr(varStr(jsonToVar(value)));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------
|
||||
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)
|
||||
{
|
||||
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)
|
||||
|
@ -36,8 +36,8 @@ typedef struct Manifest Manifest;
|
||||
#include "common/compress/helper.h"
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/crypto/hash.h"
|
||||
#include "common/type/variant.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/variant.h"
|
||||
#include "info/info.h"
|
||||
#include "info/infoBackup.h"
|
||||
#include "storage/storage.h"
|
||||
|
@ -8,10 +8,10 @@ casts to queries to output one of these types.
|
||||
#ifndef POSTGRES_QUERY_H
|
||||
#define POSTGRES_QUERY_H
|
||||
|
||||
#include "common/time.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/pack.h"
|
||||
#include "common/type/string.h"
|
||||
#include "common/time.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Query result types
|
||||
|
@ -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.
|
||||
***********************************************************************************************************************************/
|
||||
#include "postgres/interface/static.vendor.h"
|
||||
#include "postgres/version.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Types from src/include/c.h
|
||||
|
@ -6,8 +6,8 @@ Protocol Command
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/keyValue.h"
|
||||
#include "protocol/command.h"
|
||||
#include "protocol/client.h"
|
||||
#include "protocol/command.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Object type
|
||||
|
@ -165,7 +165,9 @@ storageAzureAuth(
|
||||
|
||||
// Generate authorization header
|
||||
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))))));
|
||||
}
|
||||
// SAS authentication
|
||||
|
@ -6,8 +6,8 @@ GCS Storage
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/x509.h>
|
||||
|
||||
#include "common/crypto/common.h"
|
||||
#include "common/crypto/hash.h"
|
||||
|
@ -256,7 +256,6 @@ storageWriteGcs(THIS_VOID, const Buffer *buffer)
|
||||
}
|
||||
while (bytesTotal != bufUsed(buffer));
|
||||
|
||||
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
}
|
||||
|
||||
|
@ -11,9 +11,9 @@ Storage Helper
|
||||
#include "common/regExp.h"
|
||||
#include "config/config.h"
|
||||
#include "protocol/helper.h"
|
||||
#include "storage/helper.h"
|
||||
#include "storage/posix/storage.h"
|
||||
#include "storage/remote/storage.h"
|
||||
#include "storage/helper.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
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_PARAM_P(VOID, helperList);
|
||||
|
@ -87,8 +87,12 @@ storageItrPathAdd(StorageIterator *const this, const String *const pathSub)
|
||||
OBJ_NEW_BEGIN(StorageIteratorInfo, .childQty = MEM_CONTEXT_QTY_MAX, .allocQty = 1)
|
||||
{
|
||||
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);
|
||||
}
|
||||
@ -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_PARAM(STORAGE_ITERATOR, this);
|
||||
|
@ -21,6 +21,8 @@ typedef struct StorageReadInterface
|
||||
IoReadInterface ioInterface;
|
||||
} StorageReadInterface;
|
||||
|
||||
#include "storage/read.h"
|
||||
|
||||
FN_EXTERN StorageRead *storageReadNew(void *driver, const StorageReadInterface *interface);
|
||||
|
||||
#endif
|
||||
|
@ -11,8 +11,8 @@ Remote Storage Protocol Handler
|
||||
#include "common/type/pack.h"
|
||||
#include "config/config.h"
|
||||
#include "protocol/helper.h"
|
||||
#include "storage/remote/protocol.h"
|
||||
#include "storage/helper.h"
|
||||
#include "storage/remote/protocol.h"
|
||||
#include "storage/storage.intern.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
|
@ -13,9 +13,9 @@ Remote Storage Read
|
||||
#include "common/log.h"
|
||||
#include "common/type/convert.h"
|
||||
#include "common/type/object.h"
|
||||
#include "storage/read.intern.h"
|
||||
#include "storage/remote/protocol.h"
|
||||
#include "storage/remote/read.h"
|
||||
#include "storage/read.intern.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Object type
|
||||
|
@ -5,8 +5,8 @@ Remote Storage Read
|
||||
#define STORAGE_REMOTE_READ_H
|
||||
|
||||
#include "protocol/client.h"
|
||||
#include "storage/remote/storage.intern.h"
|
||||
#include "storage/read.h"
|
||||
#include "storage/remote/storage.intern.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Constructors
|
||||
|
@ -81,12 +81,12 @@ storageS3Helper(const unsigned int repoIdx, const bool write, StoragePathExpress
|
||||
MEM_CONTEXT_PRIOR_BEGIN()
|
||||
{
|
||||
result = storageS3New(
|
||||
cfgOptionIdxStr(cfgOptRepoPath, repoIdx), write, pathExpressionCallback, cfgOptionIdxStr(cfgOptRepoS3Bucket, repoIdx),
|
||||
endPoint, (StorageS3UriStyle)cfgOptionIdxStrId(cfgOptRepoS3UriStyle, repoIdx),
|
||||
cfgOptionIdxStr(cfgOptRepoS3Region, repoIdx), keyType, cfgOptionIdxStrNull(cfgOptRepoS3Key, repoIdx),
|
||||
cfgOptionIdxStrNull(cfgOptRepoS3KeySecret, repoIdx), cfgOptionIdxStrNull(cfgOptRepoS3Token, repoIdx),
|
||||
cfgOptionIdxStrNull(cfgOptRepoS3KmsKeyId, repoIdx), role, webIdToken,
|
||||
(size_t)cfgOptionIdxUInt64(cfgOptRepoStorageUploadChunkSize, repoIdx), host, port, ioTimeoutMs(),
|
||||
cfgOptionIdxStr(cfgOptRepoPath, repoIdx), write, pathExpressionCallback,
|
||||
cfgOptionIdxStr(cfgOptRepoS3Bucket, repoIdx), endPoint,
|
||||
(StorageS3UriStyle)cfgOptionIdxStrId(cfgOptRepoS3UriStyle, repoIdx), cfgOptionIdxStr(cfgOptRepoS3Region, repoIdx),
|
||||
keyType, cfgOptionIdxStrNull(cfgOptRepoS3Key, repoIdx), cfgOptionIdxStrNull(cfgOptRepoS3KeySecret, repoIdx),
|
||||
cfgOptionIdxStrNull(cfgOptRepoS3Token, repoIdx), cfgOptionIdxStrNull(cfgOptRepoS3KmsKeyId, repoIdx), role,
|
||||
webIdToken, (size_t)cfgOptionIdxUInt64(cfgOptRepoStorageUploadChunkSize, repoIdx), host, port, ioTimeoutMs(),
|
||||
cfgOptionIdxBool(cfgOptRepoStorageVerifyTls, repoIdx), cfgOptionIdxStrNull(cfgOptRepoStorageCaFile, repoIdx),
|
||||
cfgOptionIdxStrNull(cfgOptRepoStorageCaPath, repoIdx));
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ S3 Storage Read
|
||||
#include "common/io/http/client.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/object.h"
|
||||
#include "storage/s3/read.h"
|
||||
#include "storage/read.intern.h"
|
||||
#include "storage/s3/read.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Object type
|
||||
|
@ -4,8 +4,8 @@ S3 Storage Read
|
||||
#ifndef STORAGE_S3_READ_H
|
||||
#define STORAGE_S3_READ_H
|
||||
|
||||
#include "storage/s3/storage.intern.h"
|
||||
#include "storage/read.h"
|
||||
#include "storage/s3/storage.intern.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Constructors
|
||||
|
@ -13,8 +13,8 @@ S3 Storage
|
||||
#include "common/io/tls/client.h"
|
||||
#include "common/log.h"
|
||||
#include "common/regExp.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/json.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/xml.h"
|
||||
#include "storage/s3/read.h"
|
||||
#include "storage/s3/write.h"
|
||||
|
@ -8,10 +8,10 @@ Storage Interface
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/io/io.h"
|
||||
#include "common/type/list.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "common/regExp.h"
|
||||
#include "common/type/list.h"
|
||||
#include "common/wait.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)
|
||||
{
|
||||
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
|
||||
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)) == '/')))
|
||||
{
|
||||
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_PARAM(STORAGE, this);
|
||||
|
@ -23,11 +23,11 @@ Object type
|
||||
***********************************************************************************************************************************/
|
||||
typedef struct Storage Storage;
|
||||
|
||||
#include "common/type/buffer.h"
|
||||
#include "common/type/stringList.h"
|
||||
#include "common/io/filter/group.h"
|
||||
#include "common/time.h"
|
||||
#include "common/type/buffer.h"
|
||||
#include "common/type/param.h"
|
||||
#include "common/type/stringList.h"
|
||||
#include "storage/info.h"
|
||||
#include "storage/iterator.h"
|
||||
#include "storage/read.h"
|
||||
|
@ -89,7 +89,6 @@ testBldVmId(const TestBuild *const this)
|
||||
return THIS_PUB(TestBuild)->vmId;
|
||||
}
|
||||
|
||||
|
||||
// Test Definition
|
||||
FN_INLINE_ALWAYS const TestDefModule *
|
||||
testBldModule(const TestBuild *const this)
|
||||
|
@ -4,8 +4,8 @@ Parse Define Yaml
|
||||
#ifndef TEST_COMMAND_TEST_DEFINE_H
|
||||
#define TEST_COMMAND_TEST_DEFINE_H
|
||||
|
||||
#include "common/type/list.h"
|
||||
#include "build/common/string.h"
|
||||
#include "common/type/list.h"
|
||||
#include "storage/storage.h"
|
||||
|
||||
// Test definition types
|
||||
|
@ -14,7 +14,8 @@ Harness for Creating Test Backups
|
||||
#include "common/harnessTest.h"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void hrnCmdBackup(void)
|
||||
void
|
||||
hrnCmdBackup(void)
|
||||
{
|
||||
FUNCTION_HARNESS_VOID();
|
||||
|
||||
|
@ -18,8 +18,8 @@ Harness for Loading Test Configurations
|
||||
#include "common/harnessConfig.h"
|
||||
#include "common/harnessDebug.h"
|
||||
#include "common/harnessLog.h"
|
||||
#include "common/harnessTest.h"
|
||||
#include "common/harnessStorageHelper.h"
|
||||
#include "common/harnessTest.h"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void
|
||||
|
@ -3,8 +3,8 @@ Harness for Loading Test Configurations
|
||||
***********************************************************************************************************************************/
|
||||
#include "build.auto.h"
|
||||
|
||||
#include "common/harnessError.h"
|
||||
#include "common/harnessDebug.h"
|
||||
#include "common/harnessError.h"
|
||||
#include "common/harnessLog.h"
|
||||
#include "common/harnessTest.h"
|
||||
|
||||
@ -14,7 +14,8 @@ Include shimmed C modules
|
||||
{[SHIM_MODULE]}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void hrnErrorThrow(const HrnErrorThrowParam param)
|
||||
void
|
||||
hrnErrorThrow(const HrnErrorThrowParam param)
|
||||
{
|
||||
errorContext.error.errorType = param.errorType != NULL ? param.errorType : &AssertError;
|
||||
errorContext.error.fileName = param.fileName != NULL ? param.fileName : "ERR_FILE";
|
||||
|
@ -4,10 +4,10 @@ Log Test Harness
|
||||
#include "build.auto.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <regex.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "build/common/regExp.h"
|
||||
#include "common/log.h"
|
||||
@ -95,7 +95,8 @@ hrnLogLevelFile(void)
|
||||
return logLevelFile;
|
||||
}
|
||||
|
||||
void hrnLogLevelFileSet(unsigned int logLevel)
|
||||
void
|
||||
hrnLogLevelFileSet(unsigned int logLevel)
|
||||
{
|
||||
logLevelFile = logLevel;
|
||||
}
|
||||
@ -106,7 +107,8 @@ hrnLogLevelStdOut(void)
|
||||
return logLevelStdOut;
|
||||
}
|
||||
|
||||
void hrnLogLevelStdOutSet(unsigned int logLevel)
|
||||
void
|
||||
hrnLogLevelStdOutSet(unsigned int logLevel)
|
||||
{
|
||||
logLevelStdOut = logLevel;
|
||||
}
|
||||
@ -117,7 +119,8 @@ hrnLogLevelStdErr(void)
|
||||
return logLevelStdErr;
|
||||
}
|
||||
|
||||
void hrnLogLevelStdErrSet(unsigned int logLevel)
|
||||
void
|
||||
hrnLogLevelStdErrSet(unsigned int logLevel)
|
||||
{
|
||||
logLevelStdErr = logLevel;
|
||||
}
|
||||
@ -173,7 +176,8 @@ harnessLogLevelDefaultSet(LogLevel logLevel)
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void hrnLogProcessIdSet(unsigned int processId)
|
||||
void
|
||||
hrnLogProcessIdSet(unsigned int processId)
|
||||
{
|
||||
logProcessId = processId;
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ Harness for Manifest Testing
|
||||
#ifndef TEST_COMMON_HARNESS_MANIFEST_H
|
||||
#define TEST_COMMON_HARNESS_MANIFEST_H
|
||||
|
||||
#include "info/manifest.h"
|
||||
#include "common/user.h"
|
||||
#include "info/manifest.h"
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Add db to manifest
|
||||
|
@ -12,7 +12,8 @@ Harness for Loading Test Configurations
|
||||
#include "common/harnessPack.h"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
String *hrnPackToStr(const Pack *const pack)
|
||||
String *
|
||||
hrnPackToStr(const Pack *const pack)
|
||||
{
|
||||
FUNCTION_HARNESS_BEGIN();
|
||||
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_PARAM(PACK_READ, read);
|
||||
|
@ -6,7 +6,6 @@ Macros to create harness functions per PostgreSQL version.
|
||||
#ifndef TEST_COMMON_HARNESS_POSTGRES_VERSIONINTERN_H
|
||||
#define TEST_COMMON_HARNESS_POSTGRES_VERSIONINTERN_H
|
||||
|
||||
#include "postgres/version.h"
|
||||
#include "postgres/interface/version.vendor.h"
|
||||
|
||||
#include "common/harnessPostgres.h"
|
||||
|
@ -169,7 +169,8 @@ harnessPqScriptRun(const char *const function, const VariantList *const param, c
|
||||
/***********************************************************************************************************************************
|
||||
Shim for PQconnectdb()
|
||||
***********************************************************************************************************************************/
|
||||
PGconn *PQconnectdb(const char *conninfo)
|
||||
PGconn *
|
||||
PQconnectdb(const char *conninfo)
|
||||
{
|
||||
return (PGconn *)harnessPqScriptRun(HRNPQ_CONNECTDB, varLstAdd(varLstNew(), varNewStrZ(conninfo)), NULL);
|
||||
}
|
||||
@ -177,7 +178,8 @@ PGconn *PQconnectdb(const char *conninfo)
|
||||
/***********************************************************************************************************************************
|
||||
Shim for PQstatus()
|
||||
***********************************************************************************************************************************/
|
||||
ConnStatusType PQstatus(const PGconn *conn)
|
||||
ConnStatusType
|
||||
PQstatus(const PGconn *conn)
|
||||
{
|
||||
return (ConnStatusType)harnessPqScriptRun(HRNPQ_STATUS, NULL, (HarnessPq *)conn)->resultInt;
|
||||
}
|
||||
@ -185,7 +187,8 @@ ConnStatusType PQstatus(const PGconn *conn)
|
||||
/***********************************************************************************************************************************
|
||||
Shim for PQerrorMessage()
|
||||
***********************************************************************************************************************************/
|
||||
char *PQerrorMessage(const PGconn *conn)
|
||||
char *
|
||||
PQerrorMessage(const PGconn *conn)
|
||||
{
|
||||
return (char *)harnessPqScriptRun(HRNPQ_ERRORMESSAGE, NULL, (HarnessPq *)conn)->resultZ;
|
||||
}
|
||||
@ -359,7 +362,8 @@ PQclear(PGresult *res)
|
||||
/***********************************************************************************************************************************
|
||||
Shim for PQfinish()
|
||||
***********************************************************************************************************************************/
|
||||
void PQfinish(PGconn *conn)
|
||||
void
|
||||
PQfinish(PGconn *conn)
|
||||
{
|
||||
if (harnessPqStrict && !harnessPqScriptFail)
|
||||
harnessPqScriptRun(HRNPQ_FINISH, NULL, (HarnessPq *)conn);
|
||||
|
@ -6,9 +6,9 @@ Harness for Protocol Testing
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/fork.h"
|
||||
#include "common/io/fdRead.h"
|
||||
#include "common/io/fdWrite.h"
|
||||
#include "common/fork.h"
|
||||
|
||||
#include "common/harnessConfig.h"
|
||||
#include "common/harnessDebug.h"
|
||||
|
@ -46,7 +46,8 @@ Constants
|
||||
#define HRN_SERVER_HOST "tls.test.pgbackrest.org"
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
void hrnServerInit(void)
|
||||
void
|
||||
hrnServerInit(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_PARAM(IO_WRITE, write);
|
||||
@ -101,7 +103,8 @@ IoWrite *hrnServerScriptBegin(IoWrite *write)
|
||||
FUNCTION_HARNESS_RETURN(IO_WRITE, write);
|
||||
}
|
||||
|
||||
void hrnServerScriptEnd(IoWrite *write)
|
||||
void
|
||||
hrnServerScriptEnd(IoWrite *write)
|
||||
{
|
||||
FUNCTION_HARNESS_BEGIN();
|
||||
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_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");
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************/
|
||||
unsigned int hrnServerPort(unsigned int portIdx)
|
||||
unsigned int
|
||||
hrnServerPort(unsigned int portIdx)
|
||||
{
|
||||
ASSERT(portIdx < HRN_SERVER_PORT_MAX);
|
||||
|
||||
|
@ -26,37 +26,63 @@ Dummy functions and interface for constructing test storage drivers
|
||||
static StorageInfo
|
||||
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 *
|
||||
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 *
|
||||
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 *
|
||||
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
|
||||
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
|
||||
storageTestDummyRemove(THIS_VOID, const String *file, StorageInterfaceRemoveParam param)
|
||||
{
|
||||
(void)thisVoid; (void)file; (void)param;
|
||||
(void)thisVoid;
|
||||
(void)file;
|
||||
(void)param;
|
||||
}
|
||||
|
||||
const StorageInterface storageInterfaceTestDummy =
|
||||
|
@ -11,8 +11,8 @@ C Test Harness
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common/harnessDebug.h"
|
||||
#include "common/harnessTest.h"
|
||||
#include "common/harnessLog.h"
|
||||
#include "common/harnessTest.h"
|
||||
|
||||
#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))
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user