summaryrefslogtreecommitdiffhomepage
path: root/Role
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-24 16:57:54 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-24 16:57:54 -0400
commit337091314588b67620e61c2c80cbb6180f07d440 (patch)
tree66167e8e7cb288baf3f8f49fc9dd75226877e7c0 /Role
parent9a8d3bc531647d8b96e66e6daabf2176a1df4afb (diff)
downloaddebug-me-337091314588b67620e61c2c80cbb6180f07d440.tar.gz
fix connection closing
Now when the user quits, the developer also exits.
Diffstat (limited to 'Role')
-rw-r--r--Role/Developer.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Role/Developer.hs b/Role/Developer.hs
index ffba5c4..64ff094 100644
--- a/Role/Developer.hs
+++ b/Role/Developer.hs
@@ -39,12 +39,10 @@ developer ichan ochan _ = withLogger "debug-me-developer.log" $ \logger -> do
devstate <- processSessionStart ochan logger
ok <- authUser ichan ochan devstate logger
if ok
- then inRawMode $ do
- _ <- sendTtyInput ichan devstate logger
- `concurrently` sendTtyOutput ochan devstate logger
- return ()
- else do
- hPutStrLn stderr "\nUser did not grant access to their terminal."
+ then inRawMode $ void $
+ sendTtyInput ichan devstate logger
+ `race` sendTtyOutput ochan devstate logger
+ else hPutStrLn stderr "\nUser did not grant access to their terminal."
data DeveloperState = DeveloperState
{ lastSeen :: Hash