You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-07 00:35:37 +02:00
Make protocol handlers have one function per command. This allows the logic of finding the handler to be in ProtocolServer, isolates each command to a function, and removes the need to test the "not found" condition for each handler.
30 lines
1.8 KiB
C
30 lines
1.8 KiB
C
/***********************************************************************************************************************************
|
|
Backup Protocol Handler
|
|
***********************************************************************************************************************************/
|
|
#ifndef COMMAND_BACKUP_PROTOCOL_H
|
|
#define COMMAND_BACKUP_PROTOCOL_H
|
|
|
|
#include "common/type/string.h"
|
|
#include "common/type/variantList.h"
|
|
#include "protocol/server.h"
|
|
|
|
/***********************************************************************************************************************************
|
|
Constants
|
|
***********************************************************************************************************************************/
|
|
#define PROTOCOL_COMMAND_BACKUP_FILE "backupFile"
|
|
STRING_DECLARE(PROTOCOL_COMMAND_BACKUP_FILE_STR);
|
|
|
|
/***********************************************************************************************************************************
|
|
Functions
|
|
***********************************************************************************************************************************/
|
|
// Process protocol requests
|
|
void backupFileProtocol(const VariantList *paramList, ProtocolServer *server);
|
|
|
|
/***********************************************************************************************************************************
|
|
Protocol commands for ProtocolServerHandler arrays passed to protocolServerProcess()
|
|
***********************************************************************************************************************************/
|
|
#define PROTOCOL_SERVER_HANDLER_BACKUP_LIST \
|
|
{.command = PROTOCOL_COMMAND_BACKUP_FILE, .handler = backupFileProtocol},
|
|
|
|
#endif
|