1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00
Files
pgbackrest/src/protocol/helper.h
T
David Steele 0913523096 Cleanup local/remote protocol interaction from 9367cc46.
The command option was not being set correctly when a remote was started from a local.  It was being set as 'local' rather than the command that the local was running as.

Also automatically select the remote protocol id based on whether it is started from a local (use the local protocol id) or from the main process (use 0).

These were not live issues but could cause strange behaviors as new features are added that might be hard to diagnose.
2019-02-28 09:51:19 +02:00

43 lines
2.3 KiB
C

/***********************************************************************************************************************************
Protocol Helper
***********************************************************************************************************************************/
#ifndef PROTOCOL_HELPER_H
#define PROTOCOL_HELPER_H
/***********************************************************************************************************************************
Protocol storage type enum
***********************************************************************************************************************************/
typedef enum
{
protocolStorageTypeRepo,
protocolStorageTypePg,
} ProtocolStorageType;
#include "protocol/client.h"
/***********************************************************************************************************************************
Constants
***********************************************************************************************************************************/
#define PROTOCOL_SERVICE_LOCAL "local"
STRING_DECLARE(PROTOCOL_SERVICE_LOCAL_STR);
#define PROTOCOL_SERVICE_REMOTE "remote"
STRING_DECLARE(PROTOCOL_SERVICE_REMOTE_STR);
/***********************************************************************************************************************************
Functions
***********************************************************************************************************************************/
ProtocolClient *protocolLocalGet(ProtocolStorageType protocolStorageType, unsigned int protocolId);
ProtocolClient *protocolRemoteGet(ProtocolStorageType protocolStorageType);
/***********************************************************************************************************************************
Getters
***********************************************************************************************************************************/
bool repoIsLocal(void);
/***********************************************************************************************************************************
Destructor
***********************************************************************************************************************************/
void protocolFree(void);
#endif