You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-07 00:35:37 +02:00
Improve protocol handlers.
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.
This commit is contained in:
@ -178,8 +178,9 @@ testRun(void)
|
||||
ioWriteOpen(write);
|
||||
|
||||
ProtocolServer *server = protocolServerNew(strNew("storage test server"), strNew("test"), read, write);
|
||||
protocolServerHandlerAdd(server, storageRemoteProtocol);
|
||||
protocolServerProcess(server, NULL);
|
||||
|
||||
static const ProtocolServerHandler commandHandler[] = {PROTOCOL_SERVER_HANDLER_STORAGE_REMOTE_LIST};
|
||||
protocolServerProcess(server, NULL, commandHandler, PROTOCOL_SERVER_HANDLER_LIST_SIZE(commandHandler));
|
||||
|
||||
}
|
||||
HARNESS_FORK_CHILD_END();
|
||||
|
Reference in New Issue
Block a user