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
|
@ -83,7 +83,6 @@ data Message
|
|||
| DATA Len -- followed by bytes of data
|
||||
| VALIDITY Validity
|
||||
| ERROR String
|
||||
| ProtocolEOF
|
||||
deriving (Show)
|
||||
|
||||
instance Proto.Sendable Message where
|
||||
|
@ -109,7 +108,6 @@ instance Proto.Sendable Message where
|
|||
formatMessage (VALIDITY Invalid) = ["INVALID"]
|
||||
formatMessage (DATA len) = ["DATA", Proto.serialize len]
|
||||
formatMessage (ERROR err) = ["ERROR", Proto.serialize err]
|
||||
formatMessage (ProtocolEOF) = []
|
||||
|
||||
instance Proto.Receivable Message where
|
||||
parseCommand "AUTH" = Proto.parse2 AUTH
|
||||
|
@ -369,8 +367,6 @@ serverLoop :: (Message -> Proto (ServerHandler a)) -> Proto (Maybe a)
|
|||
serverLoop a = do
|
||||
mcmd <- net receiveMessage
|
||||
case mcmd of
|
||||
-- Stop loop at EOF
|
||||
Just ProtocolEOF -> return Nothing
|
||||
-- When the client sends ERROR to the server, the server
|
||||
-- gives up, since it's not clear what state the client
|
||||
-- is in, and so not possible to recover.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue