mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-03-05 15:05:48 +02:00
Refactor remote storage protocol to use Packs instead of JSON.
Packs are more efficient and strongly typed so they make more sense for the protocol.
This commit is contained in:
parent
cfd6c7ceb4
commit
b7fccaf994
@ -14,7 +14,6 @@ Remote Storage Protocol Handler
|
||||
#include "common/log.h"
|
||||
#include "common/regExp.h"
|
||||
#include "common/type/pack.h"
|
||||
#include "common/type/json.h"
|
||||
#include "config/config.h"
|
||||
#include "protocol/helper.h"
|
||||
#include "storage/remote/protocol.h"
|
||||
@ -356,7 +355,7 @@ storageRemoteOpenReadProtocol(PackRead *const param, ProtocolServer *const serve
|
||||
const String *file = pckReadStrP(param);
|
||||
bool ignoreMissing = pckReadBoolP(param);
|
||||
const uint64_t offset = pckReadU64P(param);
|
||||
const Variant *limit = jsonToVar(pckReadStrP(param));
|
||||
const Variant *const limit = pckReadNullP(param) ? NULL : VARUINT64(pckReadU64P(param));
|
||||
const Pack *const filter = pckReadPackP(param);
|
||||
|
||||
// Create the read object
|
||||
|
@ -11,7 +11,6 @@ Remote Storage Read
|
||||
#include "common/io/read.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/convert.h"
|
||||
#include "common/type/json.h"
|
||||
#include "common/type/object.h"
|
||||
#include "storage/remote/protocol.h"
|
||||
#include "storage/remote/read.h"
|
||||
@ -75,7 +74,12 @@ storageReadRemoteOpen(THIS_VOID)
|
||||
pckWriteStrP(param, this->interface.name);
|
||||
pckWriteBoolP(param, this->interface.ignoreMissing);
|
||||
pckWriteU64P(param, this->interface.offset);
|
||||
pckWriteStrP(param, jsonFromVar(this->interface.limit));
|
||||
|
||||
if (this->interface.limit == NULL)
|
||||
pckWriteNullP(param);
|
||||
else
|
||||
pckWriteU64P(param, varUInt64(this->interface.limit));
|
||||
|
||||
pckWritePackP(param, ioFilterGroupParamAll(ioReadFilterGroup(storageReadIo(this->read))));
|
||||
|
||||
protocolClientCommandPut(this->client, command, false);
|
||||
|
@ -6,7 +6,6 @@ Remote Storage
|
||||
#include "common/debug.h"
|
||||
#include "common/log.h"
|
||||
#include "common/memContext.h"
|
||||
#include "common/type/json.h"
|
||||
#include "common/type/object.h"
|
||||
#include "common/type/pack.h"
|
||||
#include "storage/remote/protocol.h"
|
||||
|
@ -8,7 +8,6 @@ Remote Storage File write
|
||||
#include "common/io/io.h"
|
||||
#include "common/io/write.h"
|
||||
#include "common/log.h"
|
||||
#include "common/type/json.h"
|
||||
#include "common/type/object.h"
|
||||
#include "storage/remote/protocol.h"
|
||||
#include "storage/remote/write.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user