support a P2PConnection that uses TMVars rather than Handles

This will allow having an internal thread speaking P2P protocol,
which will be needed to support proxying to external special remotes.

No serialization is done on the internal P2P protocol of course.

When a ByteString is being exchanged, it may or may not be exactly
the length indicated by DATA. While that has to be carefully managed
for the serialized P2P protocol, here it would require buffering the
whole lazy bytestring in memory to check its length when sending,
so it's better to do length checks on the receiving side.
This commit is contained in:
Joey Hess 2024-06-28 11:22:29 -04:00
parent 28f5c47b5a
commit c3a785204e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 86 additions and 45 deletions

View file

@ -264,8 +264,8 @@ openP2PShellConnection' r maxprotoversion bypass = do
let conn = P2P.P2PConnection
{ P2P.connRepo = Nothing
, P2P.connCheckAuth = const False
, P2P.connIhdl = to
, P2P.connOhdl = from
, P2P.connIhdl = P2P.P2PHandle to
, P2P.connOhdl = P2P.P2PHandle from
, P2P.connIdent = P2P.ConnIdent $
Just $ "git-annex-shell connection " ++ show pidnum
}