diff options
author | Joey Hess <joeyh@joeyh.name> | 2022-03-24 12:27:02 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2022-03-24 12:27:02 -0400 |
commit | d007b5beddd398f380494403378e5f4c102592f5 (patch) | |
tree | 85cd4c1a492d00dfa83a0f1841a7c30fa659e27e | |
parent | d1a28900ea59e0850fd4ae65f0ebcef9e1a5bf9e (diff) | |
download | debug-me-d007b5beddd398f380494403378e5f4c102592f5.tar.gz |
use withPingThread to avoid build warning
forkPingThread is deprecated. Also, websockets-0.9 did not include
forkPingThread so the old dep was wrong.
-rw-r--r-- | WebSockets.hs | 18 | ||||
-rw-r--r-- | debug-me.cabal | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/WebSockets.hs b/WebSockets.hs index 7a53c8c..8aec057 100644 --- a/WebSockets.hs +++ b/WebSockets.hs @@ -164,16 +164,16 @@ clientApp -> (AnyMessage -> Maybe received) -> (TMChan sent -> TMChan (MissingHashes received) -> SessionID -> IO a) -> ClientApp a -clientApp mode mksent filterreceived a conn = do +clientApp mode mksent filterreceived a conn = -- Ping every 30 seconds to avoid timeouts caused by proxies etc. - forkPingThread conn 30 - _v <- negotiateWireVersion conn - sendBinaryData conn (SelectMode ClientSends mode) - r <- receiveData conn - case r of - Ready ServerSends sid -> bracket setup cleanup (go sid) - WireProtocolError e -> error e - _ -> protocolError conn "Did not get expected Ready message from server" + withPingThread conn 30 (return ()) $ do + _v <- negotiateWireVersion conn + sendBinaryData conn (SelectMode ClientSends mode) + r <- receiveData conn + case r of + Ready ServerSends sid -> bracket setup cleanup (go sid) + WireProtocolError e -> error e + _ -> protocolError conn "Did not get expected Ready message from server" where setup = do schan <- newTMChanIO diff --git a/debug-me.cabal b/debug-me.cabal index db7cc63..d5a44e9 100644 --- a/debug-me.cabal +++ b/debug-me.cabal @@ -1,5 +1,5 @@ Name: debug-me -Version: 1.20200820 +Version: 1.20220324 Cabal-Version: >= 1.10 Maintainer: Joey Hess <joey@kitenet.net> Author: Joey Hess @@ -81,7 +81,7 @@ Executable debug-me , http-types (>= 0.9) , http-client (>= 0.4) , http-client-tls (>= 0.2) - , websockets (>= 0.9) + , websockets (>= 0.12.6.0) , wai-websockets (>= 3.0) , uuid (>= 1.3) , protobuf (>= 0.2) |