P2P protocol version 2, adding SUCCESS-PLUS and ALREADY-HAVE-PLUS
Client side support for SUCCESS-PLUS and ALREADY-HAVE-PLUS is complete, when a PUT stores to additional repositories than the expected on, the location log is updated with the additional UUIDs that contain the content. Started implementing PUT fanout to multiple remotes for clusters. It is untested, and I fear fencepost errors in the relative offset calculations. And it is missing proxying for the protocol after DATA.
This commit is contained in:
parent
ca08f3fcc2
commit
f18740699e
12 changed files with 206 additions and 61 deletions
|
@ -1,6 +1,6 @@
|
|||
{- Simple line-based protocols.
|
||||
-
|
||||
- Copyright 2013-2020 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2013-2024 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- License: BSD-2-clause
|
||||
-}
|
||||
|
@ -21,6 +21,7 @@ module Utility.SimpleProtocol (
|
|||
parse3,
|
||||
parse4,
|
||||
parse5,
|
||||
parseList,
|
||||
dupIoHandles,
|
||||
getProtocolLine,
|
||||
) where
|
||||
|
@ -111,6 +112,10 @@ parse5 mk s = mk <$> deserialize p1 <*> deserialize p2 <*> deserialize p3 <*> de
|
|||
splitWord :: String -> (String, String)
|
||||
splitWord = separate isSpace
|
||||
|
||||
{- Only safe to use when the serialization does not include whitespace. -}
|
||||
parseList :: Serializable p => ([p] -> a) -> Parser a
|
||||
parseList mk v = mk <$> mapM deserialize (words v)
|
||||
|
||||
{- When a program speaks a simple protocol over stdio, any other output
|
||||
- to stdout (or anything that attempts to read from stdin)
|
||||
- will mess up the protocol. To avoid that, close stdin,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue