summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2020-08-20 14:04:26 -0400
committerJoey Hess <joeyh@joeyh.name>2020-08-20 14:04:26 -0400
commit3c24c417841e231c5bb38e296c136f74b0e94be8 (patch)
tree78dd9e1ca5aca66f82832fc73229c119a80b6982
parentaf32cc830d2989d1589ee5dc056f8a50df902709 (diff)
downloaddebug-me-3c24c417841e231c5bb38e296c136f74b0e94be8.tar.gz
Update to lts-14.27, support websockets 0.12.7.
This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
-rw-r--r--CHANGELOG1
-rw-r--r--Server.hs19
-rw-r--r--stack.yaml2
3 files changed, 11 insertions, 11 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d87ca68..7da480b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@ debug-me (1.20190927) UNRELEASED; urgency=medium
* debug-me.service: Remove /etc from InaccessiblePaths,
as that prevents the server sending email using eg postfix,
which needs to read its config files.
+ * Update to lts-14.27, support websockets 0.12.7.
-- Joey Hess <id@joeyh.name> Thu, 20 Aug 2020 13:15:22 -0400
diff --git a/Server.hs b/Server.hs
index 70ded97..81b573f 100644
--- a/Server.hs
+++ b/Server.hs
@@ -16,7 +16,6 @@ import Log
import Network.Wai
import Network.Wai.Handler.Warp
import Network.Wai.Handler.WebSockets
-import Network.WebSockets hiding (Message)
import qualified Network.WebSockets as WS
import Network.HTTP.Types
import Control.Concurrent
@@ -124,7 +123,7 @@ websocketApp :: ServerOpts -> TVar ServerState -> WS.ServerApp
websocketApp o ssv pending_conn = do
conn <- WS.acceptRequest pending_conn
_v <- negotiateWireVersion conn
- r <- receiveData conn
+ r <- WS.receiveData conn
case r of
SelectMode ClientSends (InitMode email) -> user email o ssv conn
SelectMode ClientSends (ConnectMode t) ->
@@ -136,7 +135,7 @@ websocketApp o ssv pending_conn = do
user :: EmailAddress -> ServerOpts -> TVar ServerState -> WS.Connection -> IO ()
user email o ssv conn = do
sid <- withSessionID (serverDirectory o) $ \(loghv, sid) -> do
- sendBinaryData conn (Ready ServerSends sid)
+ WS.sendBinaryData conn (Ready ServerSends sid)
bracket (setup sid loghv) (cleanup sid) go
return sid
doneSessionLog email o sid
@@ -173,7 +172,7 @@ user email o ssv conn = do
case v of
Just (Broadcast l _from) -> case loggedMessage l of
Developer m -> do
- sendBinaryData conn (AnyMessage (Developer m))
+ WS.sendBinaryData conn (AnyMessage (Developer m))
relaytouser userchan
User _ -> relaytouser userchan
Nothing -> return ()
@@ -188,12 +187,12 @@ developer o ssv sid conn = bracket setup cleanup go
sessionLogFile (serverDirectory o) sid
if exists
then do
- sendBinaryData conn (Ready ServerSends sid)
+ WS.sendBinaryData conn (Ready ServerSends sid)
replayBacklog o sid conn
- sendBinaryData conn Done
+ WS.sendBinaryData conn Done
else protocolError conn "Unknown session ID"
go (Just session) = do
- sendBinaryData conn (Ready ServerSends sid)
+ WS.sendBinaryData conn (Ready ServerSends sid)
devchan <- replayBacklogAndListen o sid session conn
mytid <- mkWeakThreadId =<< myThreadId
_ <- relayfromdeveloper mytid session
@@ -216,7 +215,7 @@ developer o ssv sid conn = bracket setup cleanup go
v <- atomically $ readTMChan devchan
case v of
Just (Broadcast l from) -> do
- let sendit = sendBinaryData conn
+ let sendit = WS.sendBinaryData conn
(AnyMessage $ loggedMessage l)
case loggedMessage l of
User _ -> sendit
@@ -231,7 +230,7 @@ developer o ssv sid conn = bracket setup cleanup go
else sendit
relaytodeveloper mytid devchan
Nothing -> do
- sendBinaryData conn Done
+ WS.sendBinaryData conn Done
return ()
-- | Replay the log of what's happened in the session so far,
@@ -253,7 +252,7 @@ replayBacklog :: ServerOpts -> SessionID -> WS.Connection -> IO ()
replayBacklog o sid conn = do
ls <- streamLog (sessionLogFile (serverDirectory o) sid)
forM_ ls $ \l -> case loggedMessage <$> l of
- Right m -> sendBinaryData conn (AnyMessage m)
+ Right m -> WS.sendBinaryData conn (AnyMessage m)
Left _ -> return ()
doneSessionLog :: EmailAddress -> ServerOpts -> SessionID -> IO ()
diff --git a/stack.yaml b/stack.yaml
index c8d8fef..90b2c54 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -1,6 +1,6 @@
packages:
- '.'
-resolver: lts-13.29
+resolver: lts-14.27
extra-deps:
- graphviz-2999.20.0.3
- posix-pty-0.2.1.1