summaryrefslogtreecommitdiffhomepage
path: root/Role
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-30 12:51:12 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-30 12:51:12 -0400
commit263b547ad43dff0e4948e860ac8d1cfa4f4cf0f1 (patch)
tree720a663bd99660d4c084ab43576d4c7b0b22038b /Role
parentd327ced452ecbefd819691e4b4caada41029fb87 (diff)
downloaddebug-me-263b547ad43dff0e4948e860ac8d1cfa4f4cf0f1.tar.gz
avoid STM crash on protocol error
Diffstat (limited to 'Role')
-rw-r--r--Role/Developer.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Role/Developer.hs b/Role/Developer.hs
index 0277bed..d210e50 100644
--- a/Role/Developer.hs
+++ b/Role/Developer.hs
@@ -275,7 +275,7 @@ getServerMessage ochan devstate ts = do
then do
o <- processuser ds msg
return (Just (o, User msg))
- else ignore
+ else return $ Just (ProtocolError $ "Bad signature on message from user: " ++ show msg, User msg)
-- When other developers connect, learn their SessionKeys.
Just (Developer msg@(ControlMessage (Control (SessionKey spk) _))) -> do
let sigverifier = mkSigVerifier $ case spk of
@@ -306,7 +306,7 @@ getServerMessage ochan devstate ts = do
then do
writeTVar devstate ds'
return (TtyOutput b)
- else return (ProtocolError $ "Illegal Seen value: " ++ show (act, hash act))
+ else return (ProtocolError $ "Illegal Seen value: " ++ show act)
processuser ds (ControlMessage (Control (Rejected _) _)) = do
-- When they rejected a message we sent,
-- anything we sent subsequently will