Revert "clean P2P protocol shutdown on EOF"
This reverts commit b18fb1e343
.
That broke support for old git-annex-shell before p2pstdio was added.
The immediate problem is that postAuth had a fallthrough case
that sent an error back to the peer, but sending an error back when the
connection is closed is surely not going to work.
But thinking about it some more, making every function that uses receiveMessage
need to handle ProtocolEOF adds a lot of complication, so I don't want
to do that.
The commit only cleaned up the test suite output a tiny bit, so I'm just
gonna revert it for now.
This commit is contained in:
parent
26a02cb386
commit
16cbecbd09
6 changed files with 24 additions and 17 deletions
|
@ -38,7 +38,6 @@ import Annex.ChangedRefs
|
|||
import Control.Monad.Free
|
||||
import Control.Monad.IO.Class
|
||||
import System.Exit (ExitCode(..))
|
||||
import System.IO.Error
|
||||
import Network.Socket
|
||||
import Control.Concurrent
|
||||
import Control.Concurrent.Async
|
||||
|
@ -160,11 +159,9 @@ runNet runst conn runner f = case f of
|
|||
Left e -> return (Left (show e))
|
||||
Right () -> runner next
|
||||
ReceiveMessage next -> do
|
||||
v <- liftIO $ tryIOError $ getProtocolLine (connIhdl conn)
|
||||
v <- liftIO $ tryNonAsync $ getProtocolLine (connIhdl conn)
|
||||
case v of
|
||||
Left e
|
||||
| isEOFError e -> runner (next (Just ProtocolEOF))
|
||||
| otherwise -> return (Left (show e))
|
||||
Left e -> return (Left (show e))
|
||||
Right Nothing -> return (Left "protocol error")
|
||||
Right (Just l) -> case parseMessage l of
|
||||
Just m -> do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue