diff options
author | Joey Hess <joeyh@joeyh.name> | 2018-03-07 15:15:23 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2018-03-07 15:38:01 -0400 |
commit | 6ddfa9807b3296b5f84905973efc98b5b484aa0e (patch) | |
tree | 03abfa1d75d09f7127c3b4cc02ae1fea98e9f2ac /P2P | |
parent | fa5b19f0ff68d096322288e594ee289943ba1e29 (diff) |
implemented git-annex-shell p2pstdio
Not yet used by git-annex, but this will allow faster transfers etc than
using individual ssh connections and rsync.
Not called git-annex-shell p2p, because git-annex p2p does something
else and I don't want two subcommands with the same name between the two
for sanity reasons.
This commit was sponsored by Øyvind Andersen Holm.
Diffstat (limited to 'P2P')
-rw-r--r-- | P2P/IO.hs | 10 | ||||
-rw-r--r-- | P2P/Protocol.hs | 2 |
2 files changed, 12 insertions, 0 deletions
@@ -10,6 +10,7 @@ module P2P.IO ( RunProto , P2PConnection(..) + , stdioP2PConnection , connectPeer , closeConnection , serveUnixSocket @@ -50,6 +51,15 @@ data P2PConnection = P2PConnection , connOhdl :: Handle } +-- P2PConnection using stdio. +stdioP2PConnection :: Git.Repo -> P2PConnection +stdioP2PConnection g = P2PConnection + { connRepo = g + , connCheckAuth = const False + , connIhdl = stdin + , connOhdl = stdout + } + -- Opens a connection to a peer. Does not authenticate with it. connectPeer :: Git.Repo -> P2PAddress -> IO P2PConnection connectPeer g (TorAnnex onionaddress onionport) = do diff --git a/P2P/Protocol.hs b/P2P/Protocol.hs index 81b2156cc2..c750ae6ff1 100644 --- a/P2P/Protocol.hs +++ b/P2P/Protocol.hs @@ -1,5 +1,7 @@ {- P2P protocol - + - See doc/design/p2p_protocol.mdwn + - - Copyright 2016 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. |