1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-07 00:35:37 +02:00

Filters can now produce output that differs from input.

This allows filters such as compression, encryption, etc. to be implemented.
This commit is contained in:
David Steele
2018-08-14 14:21:53 -04:00
parent a45d1b4a60
commit e3ff6b209d
27 changed files with 1320 additions and 262 deletions

View File

@ -12,32 +12,13 @@ Buffer write object
***********************************************************************************************************************************/
struct IoBufferWrite
{
MemContext *memContext;
IoWrite *io;
Buffer *write;
MemContext *memContext; // Object memory context
IoWrite *io; // IoWrite interface
Buffer *write; // Buffer to write into
};
/***********************************************************************************************************************************
Write to the buffer
***********************************************************************************************************************************/
static void
ioBufferWrite(IoBufferWrite *this, Buffer *buffer)
{
FUNCTION_DEBUG_BEGIN(logLevelTrace);
FUNCTION_DEBUG_PARAM(IO_BUFFER_WRITE, this);
FUNCTION_DEBUG_PARAM(BUFFER, buffer);
FUNCTION_DEBUG_ASSERT(this != NULL);
FUNCTION_DEBUG_ASSERT(buffer != NULL);
FUNCTION_DEBUG_END();
bufCat(this->write, buffer);
FUNCTION_DEBUG_RESULT_VOID();
}
/***********************************************************************************************************************************
Create object
New object
***********************************************************************************************************************************/
IoBufferWrite *
ioBufferWriteNew(Buffer *buffer)
@ -63,6 +44,25 @@ ioBufferWriteNew(Buffer *buffer)
FUNCTION_DEBUG_RESULT(IO_BUFFER_WRITE, this);
}
/***********************************************************************************************************************************
Write to the buffer
***********************************************************************************************************************************/
void
ioBufferWrite(IoBufferWrite *this, Buffer *buffer)
{
FUNCTION_DEBUG_BEGIN(logLevelTrace);
FUNCTION_DEBUG_PARAM(IO_BUFFER_WRITE, this);
FUNCTION_DEBUG_PARAM(BUFFER, buffer);
FUNCTION_DEBUG_ASSERT(this != NULL);
FUNCTION_DEBUG_ASSERT(buffer != NULL);
FUNCTION_DEBUG_END();
bufCat(this->write, buffer);
FUNCTION_DEBUG_RESULT_VOID();
}
/***********************************************************************************************************************************
Move the object to a new context
***********************************************************************************************************************************/